Skip to content

Commit

Permalink
Merge pull request #15683 from craftcms/bugfix/4.x-element-condition-…
Browse files Browse the repository at this point in the history
…resets-element-type

Fixed `ElementCondition::$elementType` being reset in `__construct()`
  • Loading branch information
brandonkelly committed Sep 6, 2024
2 parents b0ef441 + 636fa3d commit fa9c1a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/elements/conditions/ElementCondition.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ public function __construct(?string $elementType = null, array $config = [])
throw new InvalidConfigException("Invalid element type: $elementType");
}

$this->elementType = $elementType;
if ($elementType !== null) {
$this->elementType = $elementType;
}

parent::__construct($config);
}

Expand Down

0 comments on commit fa9c1a5

Please sign in to comment.