Skip to content

Fix relatedItems [null] for deleted relations#1979

Merged
davisagli merged 2 commits intoplone:mainfrom
aryan7081:965-null-related-item-field
Feb 20, 2026
Merged

Fix relatedItems [null] for deleted relations#1979
davisagli merged 2 commits intoplone:mainfrom
aryan7081:965-null-related-item-field

Conversation

@aryan7081
Copy link
Copy Markdown
Contributor

@aryan7081 aryan7081 commented Feb 7, 2026

Fixes #965

When a related item was deleted, the API returned relatedItems: [null] instead of [] because broken relations were still included. The fix filters by to_object so only resolvable relations are serialized and the API returns an empty list.


📚 Documentation preview 📚: https://plonerestapi--1979.org.readthedocs.build/

@mister-roboto
Copy link
Copy Markdown

@aryan7081 thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@aryan7081
Copy link
Copy Markdown
Contributor Author

@jenkins-plone-org please run jobs

Comment thread news/965.bugfix Outdated
Copy link
Copy Markdown
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@davisagli davisagli merged commit ecf452a into plone:main Feb 20, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

null is returned for RelationList fields if the reference is gone

3 participants