Ticket #13998 (new Bug)
Handle Paste events for discussion comments
Reported by: | neaj | Owned by: | tisto |
---|---|---|---|
Priority: | minor | Milestone: | 4.x |
Component: | Commenting/Discussion | Version: | 4.3 |
Keywords: | Cc: |
Description
I needed to get move some PloneHelpCenter content from one Plone 4.2 instance to another. I mounted the desired folder as a subfolder in the destination Plone site. Then I copy & pasted the content to a normal folder in the destination Plone site, and removed the mountpoint. This all seemed to work fine, until I tried to catalog the pasted content. Cataloging sent Zope into an endless loop. This was triggered in AccessControl.users.allowed, which walks up the acquisition chain. The loop manifested like this:
(Pdb) x.parent <plone.app.discussion.conversation.Conversation object at 0xf6fa8c0> (Pdb) x.parent.parent <Products.PloneHelpCenter.content.LeafPage.HelpCenterLeafPage object at 0xf6f22a8> (Pdb) x.parent.parent.parent <Acquisition.ImplicitAcquisitionWrapper object at 0x7e989b0> (Pdb) x.parent.parent.parent.parent <Products.PloneHelpCenter.content.LeafPage.HelpCenterLeafPage object at 0xf6f22a8> [... we never get past 0xf6f22a8 ...]
So the HelpCenterLeafPage object appeared to be its own parent. Strangely, this behaviour only occurred when starting from a comment. When starting from the HelpCenterLeafPage object, the acquisition chain was fine.
It so happens that all of these comments were spam, so I hacked allowed to break the loop, and deleted all the comments (thanks to zest.commentcleanup for examples!). (Then I removed my hack in allowed.) Now the imported content could be cataloged and browsed normally.
Note that the copy & paste succeeded --- I guess at this point the comments were still referring to parents in the mounted folder? It looks like the loop came up when the mount went away.
Timo suggests that this may be due to a missing Paste handler. In subscribers.zcml I see that handlers are registered for Add/Move/Remove, but not for Paste, so this may be the case.
Relevant discussion: http://sourceforge.net/p/plone/mailman/message/32199256/ http://sourceforge.net/p/plone/mailman/message/32199405/ http://sourceforge.net/p/plone/mailman/message/32199440/