What happened?
Description
I think this is two distinct issues:
- Address elements nested within a custom field on a user can appear in the main "Addresses" view.
- After deleting an address field, the
fieldId is not cleaned up, nor are the nested elements deleted.
Running garbage collection didn't seem to help, but this resave command took care of it:
ddev craft resave/addresses --element-id [[offending address ID]] --set fieldId --to "fn(\$element) => null"
Steps to reproduce
- Create an Addresses field;
- Add it to the User Profile field layout;
- Create a nested address element on a user;
- Observe that new address in the Addresses screen (despite it being owned by a custom field);
Additionally:
- Delete the custom Addresses field;
- View the Addresses screen for the same user;
- Observe error about a missing field;
Expected behavior
Addresses owned by custom fields are excluded from the native address list. (I think?)
Actual behavior
Addresses owned by custom fields leak into native address list.
Craft CMS version
5.4.1
PHP version
8.2.20
Operating system and version
macOS/Docker
Database type and version
MySQL 8.0.36
Image driver and version
No response
Installed plugins and versions
No response
What happened?
Description
I think this is two distinct issues:
fieldIdis not cleaned up, nor are the nested elements deleted.Running garbage collection didn't seem to help, but this
resavecommand took care of it:ddev craft resave/addresses --element-id [[offending address ID]] --set fieldId --to "fn(\$element) => null"Steps to reproduce
Additionally:
Expected behavior
Addresses owned by custom fields are excluded from the native address list. (I think?)
Actual behavior
Addresses owned by custom fields leak into native address list.
Craft CMS version
5.4.1
PHP version
8.2.20
Operating system and version
macOS/Docker
Database type and version
MySQL 8.0.36
Image driver and version
No response
Installed plugins and versions
No response