Commit 412c4fcf authored by Guy Thouret's avatar Guy Thouret Committed by Xander Miller
Browse files

(fix) Add extra checks for if getSubtype is callable on an entity and if no...

(fix) Add extra checks for if getSubtype is callable on an entity and if no attachment present to propagate to - Fixes #904
parent 3a5a89eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ class PropagateProperties
    {
        $this->changed = false;
        $attachment = $this->entitiesBuilder->single($activity->get('entity_guid'));
        if ($attachment === false) {
        if (empty($attachment)) {
            return;
        }

+9 −1
Original line number Diff line number Diff line
@@ -55,7 +55,15 @@ abstract class Properties
        }

        if ($this->actsOnType === [] || in_array($entity->getType(), $this->actsOnType, true)) {
            return $this->actsOnSubtype === [] || in_array($entity->getSubtype(), $this->actsOnSubtype, true);
            if ($this->actsOnSubtype === []) {
                return true;
            }

            if (!is_callable([$entity, 'getSubtype'], true)) {
                return false;
            }

            return in_array($entity->getSubtype(), $this->actsOnSubtype, true);
        }

        return false;