From 34a1dc07520d23e640e66c18a32999fb637faec7 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Thu, 16 Jan 2025 12:04:18 +0100 Subject: [PATCH 1/4] backport: Delete translation deletes all page content objects with the page/language combination --- cms/admin/pageadmin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cms/admin/pageadmin.py b/cms/admin/pageadmin.py index f5c32f8e9be..69d40bd7ddb 100644 --- a/cms/admin/pageadmin.py +++ b/cms/admin/pageadmin.py @@ -1248,6 +1248,7 @@ def delete_view(self, request, object_id, extra_context=None): page_content = self.get_object(request, object_id=object_id) page = page_content.page language = page_content.language + page_contents = PageContent.objects.filter(page=page, langauge=language) page_url = page.urls.get(language=page_content.language) request_language = get_site_language_from_request(request, site_id=page.node.site_id) @@ -1273,7 +1274,7 @@ def delete_view(self, request, object_id, extra_context=None): admin_site=self.admin_site, )[:3] to_delete_translations, __, perms_needed_translation = get_deleted_objects( - [page_content], + page_contents, request=request, admin_site=self.admin_site, )[:3] @@ -1306,7 +1307,7 @@ def delete_view(self, request, object_id, extra_context=None): messages.success(request, message) page_url.delete() - page_content.delete() + page_contents.delete() for p in saved_plugins: p.delete() From b7435cd0e6988b61cef5bb926ef5563381b443d4 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Thu, 16 Jan 2025 12:07:12 +0100 Subject: [PATCH 2/4] fix typo --- cms/admin/pageadmin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/admin/pageadmin.py b/cms/admin/pageadmin.py index 69d40bd7ddb..52abeb5869a 100644 --- a/cms/admin/pageadmin.py +++ b/cms/admin/pageadmin.py @@ -1248,7 +1248,7 @@ def delete_view(self, request, object_id, extra_context=None): page_content = self.get_object(request, object_id=object_id) page = page_content.page language = page_content.language - page_contents = PageContent.objects.filter(page=page, langauge=language) + page_contents = PageContent.objects.filter(page=page, language=language) page_url = page.urls.get(language=page_content.language) request_language = get_site_language_from_request(request, site_id=page.node.site_id) From 18c58a16fd29386df736e165b72b062c12f538ac Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Thu, 16 Jan 2025 12:49:10 +0100 Subject: [PATCH 3/4] Fix message action --- .github/workflows/releases.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index b3076c99cbc..7fc36a0b5ef 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -7,6 +7,7 @@ on: permissions: pull-requests: write + issues: write jobs: comment: From a2da84d8f8b33dc7f1b63b2fb8ce91512227b222 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Thu, 16 Jan 2025 17:25:33 +0100 Subject: [PATCH 4/4] Update cms/admin/pageadmin.py --- cms/admin/pageadmin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/admin/pageadmin.py b/cms/admin/pageadmin.py index 52abeb5869a..ab35691ccd4 100644 --- a/cms/admin/pageadmin.py +++ b/cms/admin/pageadmin.py @@ -1248,7 +1248,7 @@ def delete_view(self, request, object_id, extra_context=None): page_content = self.get_object(request, object_id=object_id) page = page_content.page language = page_content.language - page_contents = PageContent.objects.filter(page=page, language=language) + page_contents = PageContent.admin_manager.filter(page=page, language=language) page_url = page.urls.get(language=page_content.language) request_language = get_site_language_from_request(request, site_id=page.node.site_id)