-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x]: TypeError exception when trying to edit a single in the control panel #15822
Comments
Just upgraded to Craft 5.4.6 and can confirm the same issue exists. Will update the above. |
I have also just found that if I rename the handle of the |
Hi, thanks for getting in touch! I’m having a hard time replicating this. Any chance you could please send your |
In theory this should happen any time some field type (i.e. light switch field) is defined but not in use on an
I can't send you current live or dev DB backups as I have now renamed the field from Edit: files sent |
CMS > Entries > Singles > Home |
Thanks again for sending over the files! I raised a PR for this. |
Craft 4.12.6 and 5.4.7 are out with that fix. Thanks again! |
What happened?
Description
Clicking a single in the CMS (Entries > Singles > [Entry]) results in
TypeError: Cannot assign null to property craft\elements\db\ElementQuery::$inReverse of type bool in [...]/vendor/yiisoft/yii2/BaseYii.php:557
.With this stack trace:
I should add that this is a site upgraded from v4 to v5 and has been live for a while in v5.
Searching the codebase reveals we do have a custom field with the handle
inReverse
, which may be conflicting somehow. This has not been an issue until (potentially) this point though. Speaking to the content editors, this may be the first time we have tried to edit this single since the v5 upgrade.The custom
inReverse
field is attached to an Entry Type in a Matrix that is not in use on this particular single (in fact the entries that do use the Matrix that does contain it load fine). It's possible that due to the wayCustomFieldBehavior
works that perhaps it'snull
value in this context is getting transferred into an eager load map somehow?Steps to reproduce
As above.
Expected behavior
The screen to edit the entry is shown.
Craft CMS version
5.3.65.4.6PHP version
8.3.7
Database type and version
MySQL 8.0.37
The text was updated successfully, but these errors were encountered: