You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling $condition->matchElement($entry) on a $condition of type craft\elements\conditions\entries\EntryCondition, which has a rule for which entry types match, false is always returned. This is reproducible using Neo, which implements block type filtering based on entry/category/etc. conditions, and if a block type has an entry condition rule set for entry types, that block type won't be available to use on any entry type. The block type condition settings themselves don't do anything special to change the saved values (as far as I'm aware) and the entry type UID is saved for the rule in the database. Other rules that can be used for entry conditions (e.g. the section and date created rules) are working as expected.
Install Neo, create a Neo field with two block types.
Go to one of the block types' settings, expand the 'advanced' section to see the condition settings
Under 'Entry Condition', set an entry type rule
Edit an entry with the chosen entry type
The block type with the condition is not visible
Expected behavior
That the scenario outlined in spicywebau/craft-neo#634 (comment) (where the entry type being compared has the same UID as is recorded in the EntryCondition) would return true.
Actual behavior
The above scenario with the matching entry type UID returns false.
Craft CMS version
4.2.3
PHP version
8.1.10
Operating system and version
macOS Monterey 12.5.1
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
Neo 3.3.7
The text was updated successfully, but these errors were encountered:
What happened?
Description
When calling
$condition->matchElement($entry)
on a$condition
of typecraft\elements\conditions\entries\EntryCondition
, which has a rule for which entry types match,false
is always returned. This is reproducible using Neo, which implements block type filtering based on entry/category/etc. conditions, and if a block type has an entry condition rule set for entry types, that block type won't be available to use on any entry type. The block type condition settings themselves don't do anything special to change the saved values (as far as I'm aware) and the entry type UID is saved for the rule in the database. Other rules that can be used for entry conditions (e.g. the section and date created rules) are working as expected.Please let me know if you need any other info.
Steps to reproduce
The following steps to reproduce are based on those from spicywebau/craft-neo#634.
Expected behavior
That the scenario outlined in spicywebau/craft-neo#634 (comment) (where the entry type being compared has the same UID as is recorded in the
EntryCondition
) would returntrue
.Actual behavior
The above scenario with the matching entry type UID returns
false
.Craft CMS version
4.2.3
PHP version
8.1.10
Operating system and version
macOS Monterey 12.5.1
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: