You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In very special occasions, attempting to edit a page results in a database integrity error. This is caused by a Placeholder-object holding plugins in different languages. In our project we have 3 placeholders (out of 83k) where placeholder.cmsplugin_set.all() delivers plugins in German as well as in English.
This presumably is a data inconsistency, but I'm unsure of it.
Steps to reproduce
Open that special page (a page with a placeholder holding plugins in different languages) – unable to reproduce this in the first place.
Click on the button named "New page content".
This raises the following exception:
IntegrityError at /en/admin/djangocms_versioning/pagecontentversion/4562/edit-redirect/
duplicate key value violates unique constraint "cms_cmsplugin_placeholder_id_language_position_bad60ebe_uniq"
DETAIL: Key (placeholder_id, language, "position")=(213316, de, 2) already exists.
Additional information (CMS/Python/Django versions)
Happens in Django-CMS 4.1
Do you want to help fix this issue?
In order to prevent this, we could change this line:
Description
In very special occasions, attempting to edit a page results in a database integrity error. This is caused by a
Placeholder
-object holding plugins in different languages. In our project we have 3 placeholders (out of 83k) whereplaceholder.cmsplugin_set.all()
delivers plugins in German as well as in English.This presumably is a data inconsistency, but I'm unsure of it.
Steps to reproduce
This raises the following exception:
Additional information (CMS/Python/Django versions)
Happens in Django-CMS 4.1
Do you want to help fix this issue?
In order to prevent this, we could change this line:
https://github.com/django-cms/djangocms-versioning/blob/f726bc203c06ccbb8ba79dc9defb98d1b4e06a9d/djangocms_versioning/cms_config.py#L216
to
but this just fixes the symptoms but not the root cause.
Instead, I wrote a small script to reduce the contents of those 3 placeholders to just their proper language.
The text was updated successfully, but these errors were encountered: