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
The old plugin content is deleted after clicking cancel with new nested plugins #641
Comments
@sgordeychuk Thanks for this excellent bug report! |
I reproduce it also with I wonder if a downgrade to |
The same issue in our project.
|
@DmytroLitvinov Here's the PR: #653 |
@fsbraun thanks a lot for the fix! I've tested it with my setup and everything works great now. Should I close the ticket or will you do it? |
Just done! Thanks ;-) |
Steps to reproduce
Expected result
Only new nested plugin was removed, but the text content and old plugins remains the same
Actual result
The whole content of plugin is cleared, the whole old published content is lost
Analysis
I've tried to debug the issue and found that
cms.admin.placeholderadmin.PlaceholderAdminMixin.edit_plugin
is called on Cancel click because newly created plugins should be cleared, which is make sense. Although inside that method I can see that new Text plugin instance is created, then plugins which are not needed should be cleared. But even addingplugin.body = obj.body
there doesn't help, because it's being overwritten somewhere inside in operations.CHANGE_PLUGIN calls.Do you have any ideas where to look at? I have a feeling that it's something with post_placeholder_operation call which doesn't copy the content from the old plugin, but not sure.
djangocms-test-ckeditor==5.1.1 (also reproducible with 5.1.2)
djangocms==3.9.0 (but also reproducible with 3.11.1)
The text was updated successfully, but these errors were encountered: