-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[BUG] Moved plugins sometimes end at the wrong location #7898
Comments
Do you programmatically create plugins (e.g. with cascade)? Here's a repo that includes a management command to fix the plugin tree: https://github.com/fsbraun/djangocms4-utilities Try to fix with Duplicate of #7391 |
Yes, through an import script. However, this script doesn't seem to be the culprit. I re-imported that content and ran After running a modified version of |
The import script should be ok if it only uses Other common situations include automated creation of, say, columns when creating a row. |
Another potential source of the gaps could have been running the I just realised when going through the changes of 4.1.1 |
Description
This is a weird problem and presumably difficult to reproduce.
I have a placeholder with hundreds of plugins with up to four nesting levels. If I open the the structure tree and move a plugin in one of the upper part, everything works fine. If however, I try to drag a plugin in the lower part of the structure tree, it is moved but after a short period it appears somewhere else.
Screen.Recording.2024-04-29.at.15.46.14.mov
Steps to reproduce
I therefore added a breakpoint to see what's going on.
Then I dragged the penultimate plugin in the opened subtree to the first position. Here I checked the positions of the current plugins:
Since the plugin is moved to the first position, I would expect
request.POST['target_position']
to be 161. It however is 186. After dropping the plugin it remains where left, but after a short period it jumps to back to the penultimate position. This, because it has been moved to 186 instead of 161 andget_plugin_tree_as_json()
then retrieves the complete subtree.What's interesting is, that the
position
-field of the plugins in that subtree does not have a consecutive range, it jumps from 165 to 178 at the 6. position. Check the list comprehension shown above.Additional information (CMS/Python/Django versions)
Django-CMS 4.1, latest commit on branch
develop-4
.Do you want to help fix this issue?
The text was updated successfully, but these errors were encountered: