-
Notifications
You must be signed in to change notification settings - Fork 22
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
[BUG] Broken copy/pasting for custom plugins with untangled fields extending CMSUIPlugin, FrontendUIItem and EntangledModelForm #194
Comments
An interesting fact here, is that almost the same plugin, but as a proxy model (without the added fields I'm including my test project with 3 plugins, one non-frontendUI plugin, one using a proxy model and the one described in the bug. |
@adlh Thank you so much for the detailed bug report. This was extremely helpful! I looked into this. Let me start with a few comments:
However, I recognize that there is a legitimate use case for your situation, e.g., if you need a reference with guaranteed referential integrity. There's a shortcoming in djangocms-frontend's set up which I would like to update. Besides Then you'd have two options to extend djangocms-frontend plugins:
@marksweb Do you have any thoughts on this? |
@adlh And yes: The documentation is misleading, since it suggests you can just remove the proxy status of the model. 🤦♂️ |
Thanks @fsbraun for analyzing the problem. I think I can work with proxy models for the time being. Most of the plugins I'm migrating need only some options or text-fields, so that shouldn't be a problem. And yes, the docs were really misleading on that part :-D |
Fixed with #195 |
Description
A custom plugin (built as described in the djangocms-frontend docs, with new fields in the model), breaks when copy-pasting it on a page. After pasting it, no new item appears, as expected, and instead of it, the child plugins inside it are pasted into the original plugin (twice).
Steps to reproduce
Steps to reproduce the behavior:
test_plugins
.test_plugins/templates/test_plugins/custom_frontend_plugin.html
:makemigrations
and thenmigrate
.Text
plugin with some text.Expected behaviour
A new instance of the custom plugin should appear with a copy of the child Text plugin inside it.
Actual behaviour
No new plugin is created and the original instance gets duplicates of the child plugins instead.
Screenshots
Additional information (CMS/Python/Django versions)
Using virtualenv with python 3.10 and the following output of
pip freeze
:Do you want to help fix this issue?
The text was updated successfully, but these errors were encountered: