-
Notifications
You must be signed in to change notification settings - Fork 257
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
modeltranslation 0.19.3+ with Django CMS 4.1.x - CMS Plugin functionalities broken #748
Comments
Just tested with django-cms 3.11.x - affected as well. |
Hello. Are you sure version 0.19.0 is working? because i there isn't much changes. But jump from 0.18 to 0.19 included some relatively big changes. If you have time, please do additional testing using git version and |
@last-partizan yes, everything below 0.19.3 is working as expected. I will look into it over weekend probably and let you know. |
for me as well, it is |
0.9.13 introduces changes on the admin clasess, that is what the cms uses, it makes sense to me. |
Yeah, there's some changes in admin, but they're mostly related to typing support. If someone can provide repo with minimal reproduction, i can look into this. |
I can confirm it, 0.19.2 works, and 0.19.3 introduces the bug in both django-cms 3.11.6 and 4.1.2. |
So here is a minimal repo for reproducing the issue: I have added modeltranslation to django-cms-quickstart and published a fork here: https://github.com/MacLake/django-cms-quickstart/tree/modeltranslation. Follow the instructions to get the project running. First add a plugin that can contain other plugins, e. g. a Jumbotron, at top level. You can add a text plugin. to the Jumotron. Then add a container, add a Jumbotron to the container. Now you can’t add a text or any other plugin to this Jumbotron, as it is locked. This is caused by modeltranslation>=0.19.3. Then stop the containers, switch to the main branch (i.e. without modeltranslation) and run docker compose build
docker compose up The database content persists. Open the structure board Now the nested Jumbotron doesn’t have a lock icon, and you can add plugins to it. |
This is for reproducing the bug mentioned in deschler/django-modeltranslation#748
there is some background info in #745. The problem seems hidden and complicated. |
I think I found the problem. Dict access of a admin class that inherits from a TranslationAdmin is possible, and doesn't throw any error. As far as I know, that kind of access is/should never be possible, or only in special cases (fabric 1 did have some kind of "DictObject", for it's env...)? As Django itself relies on it, in it's template engine.
Also, a PR that shows that: #749 (test fails with 0.19.3+, runs ok below) |
#755 resolves this problem for me. |
Thanks for testing, merged and released. |
Thanks! |
As stated in Django CMS issue tracker: django-cms/django-cms#7948
Django CMS 4.1.x with modeltranslation active - custom CMS plugin attributes
allow_children
, andchild_classes
do not work correctly.Each plugin that has
allow_children
has the ability to add child plugins but they are locked (one is not able to add plugins to children even though theallow_children
withchild_classes
is set on Column in this example).On the other hand, plugins that do not have explicitly set the
allow_children
attribute still have the ability to add children which is wrong.Image 1 - working example with modeltranslation 0.19.2 - Text plugin has the + sign disabled which is expected, and the Column plugins have the + sign enabled which is expected:
Image 2 - not working example with modeltranslation 0.19.3 and above - Text plugin has the + sign enabled which is not expected, and the Column plugins have the lock sign which is not expected since no other plugins can be added into it:
Project environment variables
The text was updated successfully, but these errors were encountered: