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 adding an entry condition to a neo block (let's say: only if the author belongs to the Administrator group), this condition is verified, even for a section of type single. The single type does not have an author id, so in the InputAsset.php in the following lines will lead to an error and break the cp edit page.
function($blockType) use ($conditionsService, $owner, $ownerClass) {
if (isset($blockType->conditions[$ownerClass])) {
$condition = $conditionsService->createCondition($blockType->conditions[$ownerClass]);
return $condition->matchElement($owner);
}
return true;
}
Neo should check if the section type of the entry is single or not, as you can break the control panel with this condition.
Steps to reproduce
Create a neo field and a neo block with a condition on the entry type (author has to be administrator)
Add the field in the layout of an entrytype of a section of type single
The cp can't show the edit page of the single page anymore, as no author_id is present to check for an administrator group.
Expected behaviour
No response
Neo version
4.1.2
Craft CMS version
4.8.9
What is the affected Neo field's propagation method?
No response
Does this issue involve templating, and if so, is eager-loading used?
This is not a templating issue
The text was updated successfully, but these errors were encountered:
I'm unable to reproduce an error when viewing a single after adding an entry author condition rule to a Neo block type. The block type with the condition applied just doesn't appear as an option on the single, which - given that singles don't have authors, as you've noted - is the correct behaviour.
I'm guessing I'm missing some other detail or misunderstanding something about how to reproduce the error. If possible, could you please provide a video demonstration of the steps you can take to reliably reproduce the error? If not, then could you please post a stack trace?
I can reproduce this error when applying an author group condition rule to a (non-Neo) field being used on the single's field layout. So Craft's author group condition rule code will need to be fixed, to account for the possibility that $element doesn't have an author.
Bug Description
When adding an entry condition to a neo block (let's say: only if the author belongs to the Administrator group), this condition is verified, even for a section of type single. The single type does not have an author id, so in the InputAsset.php in the following lines will lead to an error and break the cp edit page.
Neo should check if the section type of the entry is single or not, as you can break the control panel with this condition.
Steps to reproduce
Expected behaviour
No response
Neo version
4.1.2
Craft CMS version
4.8.9
What is the affected Neo field's propagation method?
No response
Does this issue involve templating, and if so, is eager-loading used?
This is not a templating issue
The text was updated successfully, but these errors were encountered: