django-cms / djangocms-text-ckeditor

Text Plugin for django CMS using CKEditor 4
https://www.django-cms.org/en/repositories-plugins/
BSD 3-Clause "New" or "Revised" License
167 stars 185 forks source link

fix: Issue #641 created by typo in widgets.py #652

Closed fsbraun closed 1 year ago

fsbraun commented 1 year ago

Description

This PR fixes issue #641.

I traced it back to a simple typo in widgets.pywhich left the cancel_plugin_url property in the editor's setting empty (but filled the unused property clancel_plugin_url).

In effect, the cmspluings' plugin.js in turn creates a POST request with empty content to the edit endpoint (where the form was originally loaded), effectively deleting the text as opposed to the newly created plugins. The correct behavior would call the cancel_plugin_url endpoint which in turn deletes any added child plugins when cancel is pressed.

References

codecov[bot] commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (25e28e3) 76.36% compared to head (17edc8d) 76.36%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #652 +/- ## ======================================= Coverage 76.36% 76.36% ======================================= Files 20 20 Lines 918 918 Branches 123 123 ======================================= Hits 701 701 Misses 191 191 Partials 26 26 ``` | [Files](https://app.codecov.io/gh/django-cms/djangocms-text-ckeditor/pull/652?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=django-cms) | Coverage Δ | | |---|---|---| | [djangocms\_text\_ckeditor/widgets.py](https://app.codecov.io/gh/django-cms/djangocms-text-ckeditor/pull/652?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=django-cms#diff-ZGphbmdvY21zX3RleHRfY2tlZGl0b3Ivd2lkZ2V0cy5weQ==) | `81.53% <ø> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DmytroLitvinov commented 1 year ago

I can confirm that the patch works for me 👍.