-
Notifications
You must be signed in to change notification settings - Fork 23
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
djangocms-versioning draft deletion causes plugins to disappear from pages #214
Comments
Just to clarify: how do you delete the draft alias? |
@fsbraun: i went to the preview of the alias, clicked on "Versions" in the top-bar, and clicked on the trash icon of the draft in the table of listed versions |
From the code I fear the plugins are even deleted if there are alias contents available in other languages. To me it only makes sense to delete thos plugins if the whole Alias is deleted. |
Hm, I think this is a serious bug. It would also imply that an alias plugin is removed from a published page. I can only assume that the following happened:
One solution for me would be to remove the mechanism and to add a warning message (using the message framework) which would trigger if the last alias content of a language was deleted. @fscherf Would you be interested to create a pull request? |
@fsbraun: Yes! Alias plugins are disappearing from published pages definitely. Ok. That would mean, the deletion of an AliasContent object wouldn't trigger the deletion of cms plugins anymore. What do we do with orphaned cms plugins that point to no longer existing AliasContents then? Yes, I would be interested in opening a pull-request, once we decided on how to fix this issue. |
They'll point to an Deleting For now, I would be fine with the warning through the message framework. In the alias's admin delete view:
|
Previously, `djangocms_alias.models.AliasContent.delete` deleted all plugins related to `AliasContent.alias`, with the same language. Drafts and previously published versions included. This meant that the deletion of a draft resulted in plugins disappearing from published pages. This patch removes the mechanism entirely and instead adds a warning, notifying the user that the last version or translation of a language got deleted. Signed-off-by: Florian Scherf <mail@florianscherf.de>
Previously, `djangocms_alias.models.AliasContent.delete` deleted all plugins related to `AliasContent.alias`, with the same language. Drafts and previously published versions included. This meant that the deletion of a draft resulted in plugins disappearing from published pages. This patch removes the mechanism entirely and instead adds a warning, notifying the user that the last version or translation of a language got deleted. Signed-off-by: Florian Scherf <mail@florianscherf.de>
Previously, `djangocms_alias.models.AliasContent.delete` deleted all plugins related to `AliasContent.alias`, with the same language. Drafts and previously published versions included. This meant that the deletion of a draft resulted in plugins disappearing from published pages. This patch removes the mechanism entirely and instead adds a warning, notifying the user that the last version or translation of a language got deleted. Signed-off-by: Florian Scherf <mail@florianscherf.de>
Previously, `djangocms_alias.models.AliasContent.delete` deleted all plugins related to `AliasContent.alias`, with the same language. Drafts and previously published versions included. This meant that the deletion of a draft resulted in plugins disappearing from published pages. This patch removes the mechanism entirely and instead adds a warning, notifying the user that the last version or translation of a language got deleted. Signed-off-by: Florian Scherf <mail@florianscherf.de>
* fix djangocms-versioning draft deletion bug (#214) Previously, `djangocms_alias.models.AliasContent.delete` deleted all plugins related to `AliasContent.alias`, with the same language. Drafts and previously published versions included. This meant that the deletion of a draft resulted in plugins disappearing from published pages. This patch removes the mechanism entirely and instead adds a warning, notifying the user that the last version or translation of a language got deleted. Signed-off-by: Florian Scherf <mail@florianscherf.de> * ci: auto fixes from pre-commit hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Florian Scherf <mail@florianscherf.de> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@fsbraun Thanks for merging! When will the fix be released? |
I hope within the next 2 weeks. |
Published with 2.0.1 |
…cms#215) * fix djangocms-versioning draft deletion bug (django-cms#214) Previously, `djangocms_alias.models.AliasContent.delete` deleted all plugins related to `AliasContent.alias`, with the same language. Drafts and previously published versions included. This meant that the deletion of a draft resulted in plugins disappearing from published pages. This patch removes the mechanism entirely and instead adds a warning, notifying the user that the last version or translation of a language got deleted. Signed-off-by: Florian Scherf <mail@florianscherf.de> * ci: auto fixes from pre-commit hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Florian Scherf <mail@florianscherf.de> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix djangocms-versioning draft deletion bug (#214) (#215) * fix djangocms-versioning draft deletion bug (#214) Previously, `djangocms_alias.models.AliasContent.delete` deleted all plugins related to `AliasContent.alias`, with the same language. Drafts and previously published versions included. This meant that the deletion of a draft resulted in plugins disappearing from published pages. This patch removes the mechanism entirely and instead adds a warning, notifying the user that the last version or translation of a language got deleted. Signed-off-by: Florian Scherf <mail@florianscherf.de> * ci: auto fixes from pre-commit hooks for more information, see https://pre-commit.ci --------- Signed-off-by: Florian Scherf <mail@florianscherf.de> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * tests: requirements: django42: fix broken djangocms-versioning URL Signed-off-by: Florian Scherf <mail@florianscherf.de> --------- Signed-off-by: Florian Scherf <mail@florianscherf.de> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
When I use djangocms-alias with djangocms-versioning and I delete a draft of an alias, the alias does not get reset to the previous version on the pages using it. Instead, it gets removed entirely from all pages.
Steps to reproduce:
I think the problem is rooted in this line in
models.AliasContent.delete
. From the code, it looks like this is wanted behavior because it deliberately deletes all plugins using the deleted Alias Content. Hence I am not sure how to fix it (just removing it works for me).I use django-cms 4.1, and I was able to reproduces this behavior in all djangocms-alias versions I tried, including the latest master.
The text was updated successfully, but these errors were encountered: