Fix person content type folderish behaviour - #467
Merged
Merged
Conversation
reekitconcept
requested changes
Aug 6, 2026
Member
There was a problem hiding this comment.
In general this is good and it fixes the real issue correctly, but I'd like to ask you make two changes:
- Add a test! There are zero tests for the Person serializer, which is exactly why #354's regression shipped unnoticed. Without one, the next person to touch this file reintroduces it. Minimal version, but instead of adding it myself please add it and test it out:
def test_person_is_folderish(self, portal):
with api.env.adopt_roles(["Manager"]):
person = api.content.create(
container=portal, type="Person",
id="jane-doe", given_name="Jane", family_name="Doe",
)
api.content.create(container=person, type="Image", id="portrait")
result = getMultiAdapter((person, portal.REQUEST), ISerializeToJson)()
assert result["is_folderish"] is True
assert result["items_total"] == 1
# the vocabulary enrichment must survive
assert "locations" in result
assert "organisational_units" in resultThe last two assertions are the important ones. They pin both invariants together, so a future change can't trade one for the other.
- Change the news entry name to
467.bugfix: when there is a ticket number we should use it so it shows in the changelog. We use the+personIsFolderish...bugfixformat only when there is no ticket.
Please ask me to review the final again when you're done!
Member
Author
|
@reekitconcept i added the test and rename the changelog file. |
reekitconcept
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.