Skip to content
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

plone.api.content.create doesn't adapt behaviors #457

Open
thet opened this issue Mar 22, 2021 · 3 comments
Open

plone.api.content.create doesn't adapt behaviors #457

thet opened this issue Mar 22, 2021 · 3 comments

Comments

@thet
Copy link
Member

thet commented Mar 22, 2021

When using plone.api.content.create together with Dexterity types which have behaviors with custom behavior factory classes (e.g. with the behavior attribute test123 which sets a marker interface in the behavior factory class instead of an attribute), then content creation leads to unexpected results.
E.g. plone.api.content.create(container, "TestType", "testid", "testtile", test123=True) sets an attribute on the content object instead of a marker interface.

This could be solved when using plone.dexterity.utils.createContentInContainer.

Related:

@ale-rt
Copy link
Member

ale-rt commented May 18, 2022

Might be fixed by #484

@avoinea
Copy link
Sponsor Member

avoinea commented Sep 15, 2023

@thet @ale-rt I confirm the issue. No behavior calls on setattr:

@davisagli
Copy link
Sponsor Member

I've also been surprised by this. On the other hand, I've also written code that depends on the way it works currently. So it's a hard question what to do about backwards compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants