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
I am using django cms (3.2.5 and Django 1.9.5) with treebeard (4.1.2). Even time I try to delete a CMS plugin it fails with an error 500 and MultipleObjectsReturned: get() returned more than one CMSPlugin -- it returned 36 as error.
The issue happens at MP_NodeQuerySet#delete after finding all the nodes to remove (in my case just one)
# ok, got the minimal list of nodes to remove...# we must also remove their children# and update every parent node's numchild attribute# LOTS OF FUN HERE!forpath, nodeinremoved.items():
parentpath=node._get_basepath(node.path, node.depth-1)
ifparentpath:
ifparentpathnotinparents:
parents[parentpath] =node.get_parent(True)
parent=parents[parentpath]
ifparentandparent.numchild>0:
parent.numchild-=1parent.save()
ifnode.is_leaf():
toremove.append(Q(path=node.path))
else:
toremove.append(Q(path__startswith=node.path))
at the parents[parentpath] = node.get_parent(True) line. The database seems to returns multiple parents. Might it be caused by the fact that in the database I have multiple cms plugins with the same path? (https://marcoacierno.space/xQzR3Qogo4.png)
(EDIT: I just found that when you delete a root node it also deletes content from other pages because the path starts the same way, (the node.is_leaf() == false if))
If it helps, I also have an issue where, sometimes (at random), when changing/adding/deleting (even if it never works) most content of my website gets mixed up (images/text etc gets moved to the current blogpost)
Any suggestion to how to fix this issue? Or it's a known issue?
Thank you!
The text was updated successfully, but these errors were encountered:
Hi, I know it's been years and your png isn't there any more, but it surely was a problem with the queryset. There are a lot of warnings on how to properly subclass querysets. Cheers!
I am using django cms (3.2.5 and Django 1.9.5) with treebeard (4.1.2). Even time I try to delete a CMS plugin it fails with an error 500 and
MultipleObjectsReturned: get() returned more than one CMSPlugin -- it returned 36
as error.The issue happens at
MP_NodeQuerySet#delete
after finding all the nodes to remove (in my case just one)at the
parents[parentpath] = node.get_parent(True)
line. The database seems to returns multiple parents. Might it be caused by the fact that in the database I have multiple cms plugins with the same path? (https://marcoacierno.space/xQzR3Qogo4.png)(EDIT: I just found that when you delete a root node it also deletes content from other pages because the path starts the same way, (the node.is_leaf() == false if))
If it helps, I also have an issue where, sometimes (at random), when changing/adding/deleting (even if it never works) most content of my website gets mixed up (images/text etc gets moved to the current blogpost)
Any suggestion to how to fix this issue? Or it's a known issue?
Thank you!
The text was updated successfully, but these errors were encountered: