Closed sneridagh closed 2 years ago
@mauritsvanrees, @pbauer Considering the 2.0x branch only targets Python 3, I'm considering checking if the returned value is an instance of Dexterity, if it is not an instance, return None. Any objections?
I see the issue, +1 on removing this "buggy feature".
What about checking if the object found provides the Products.CMFCore.interfaces.IContentish
interface?
btw, while I was debugging this further, I've found something I was not aware of... turns out that Zope does not allow you to create a child content object with the same name as a parent DX field name.
Do we have this fact documented?
eg. I can't create a content with blocks
id inside anything.
IDK where it is documented but I am pretty sure that it is related to the implementation of parent._checkId
.
Discussion Item is not dexterity. Might be contentish. They should be returned I think.
Given a path like:
path = '/de/examples/blocks
and no content named blocks, it will get and return the
blocks
field content, because ofrestrictedTraverse
...Since
plone.api.content.get
promises to return a content type, we should not return anything that it's not.