Closed yannkost closed 1 month ago
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?
Here is a stacktrack screenshot
and here the configuration for the field
I didn't really had time to make a video.
Thanks for posting those screenshots.
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