Skip to content

Commit

Permalink
Fixed ElementCondition::$elementType being reset in __construct()
Browse files Browse the repository at this point in the history
  • Loading branch information
nfourtythree committed Sep 6, 2024
1 parent 680fa38 commit fd73f99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Fixed styling issues with Template field layout UI elements’ selector labels.
- Fixed a validation error that could occur when saving a relational field, if the “Maintain hierarchy” setting had been enabled but was no longer applicable. ([#15666](https://github.com/craftcms/cms/issues/15666))
- Fixed an information disclosure vulnerability.
- Fixed a bug where element conditions could have their `$elementType` property reset.

## 4.12.0 - 2024-09-03

Expand Down
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 fd73f99

Please sign in to comment.