Ticket #13603 (confirmed Bug)

Opened 3 years ago

Last modified 2 years ago

deletion by acquisition

Reported by: yulka Owned by: gotcha
Priority: major Milestone: 4.x
Component: General Version: 4.3
Keywords: Cc: esteele, gotcha

Description (last modified by spereverde) (diff)

If a user "deletes" the same item twice (ex.: having two different tabs open and not realising it's already been deleted) any higher level item with the same short name will be deleted without trace.

Steps to reproduce on a default Plone4.1 site:

Undo logs would look as if the same item has been deleted twice:

/Plone/folder_delete Deleted test (/Plone/f1/f2/test) by admin 2013-05-27 14:30:07
/Plone/folder_delete Deleted test (/Plone/f1/f2/test) by admin 2013-05-27 14:29:55
/Plone/portal_factory Edited ATDocument test at http://xxx:8080/Plone/f1/f2/test by admin 2013-05-27 14:29:18
/Plone/portal_factory Edited ATFolder f2 at http://xxx:8080/Plone/f1/f2 by admin 2013-05-27 14:29:03
/Plone/portal_factory Edited ATFolder f1 at http://xxx:8080/Plone/f1 by admin 2013-05-27 14:28:55
/Plone/portal_factory Edited ATFolder test at http://xxx:8080/Plone/test by admin 2013-05-27 14:28:42

Change History

comment:1 Changed 3 years ago by kleist

  • Priority changed from minor to major
  • Status changed from new to confirmed
  • Component changed from Unknown to General

Can this be reproduced with Plone 4.2 / 4.3?

If not, the ticket will possibly be closed since we support just the two latest minor versions.

comment:2 Changed 3 years ago by yulka

Confirmed running the Plone 4.3 release. In the example below the root news folder gets silently deleted. The undo logs in reverse order:

 /Plone43/folder_delete Deleted news (/Plone43/test/newsfolder/news) by admin 2013-05-29 09:04:10	
/Plone43/folder_delete Deleted news (/Plone43/test/newsfolder/news) by admin 2013-05-29 09:03:02
 /Plone43/portal_factory Edited ATNewsItem news at http://xxx:8081/Plone43/test/newsfolder/news by admin 2013-05-29 09:02:27 

comment:3 Changed 3 years ago by kleist

  • Cc esteele added
  • Version changed from 4.1 to 4.3

comment:4 Changed 2 years ago by gotcha

comment:5 Changed 2 years ago by spereverde

  • Status changed from confirmed to closed
  • Resolution set to fixed

Fix was added in Products.CMFPlone 4.3.3 release:  https://github.com/plone/Products.CMFPlone/blob/4.3.3/docs/CHANGES.rst

comment:6 Changed 2 years ago by spereverde

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:7 Changed 2 years ago by spereverde

just retested on our setup with Plone 4.3.3 and it appears that the fix submitted in PloneTool.py not only doesn't work, deletion still happens there, but it apparently prevents deletion of anything from folder_contents when not on portal_root. Could someone please asap verify on a default Plone site, cause Plone 4.3.3 might not want to go live with this issue.

Following error when you try to delete something from folder_contents (not on plone site root):

img/frans-20van-20daele.jpg (Path img/frans-20van-20daele.jpg does not start with path to portal) kon(den) niet verwijderd worden.

traceback:

2014-02-28 12:29:10 ERROR Plone  
Traceback (most recent call last):
  File "/opt/etc/buildout64/eggs/Products.CMFPlone-4.3.3-py2.7.egg/Products/CMFPlone/PloneTool.py", line 1250, in deleteObjectsByPaths
    raise ValueError(msg)
ValueError: Path img/frans-20van-20daele.jpg does not start with path to portal

comment:8 Changed 2 years ago by spereverde

gotcha just checked on a default Plone site with the 4.3.3 buildout and there it seems not to break deleting object from folder_contents in a folder,. We'll test further on our setup. We use collective.actions.delete for confirmation when deleting from folder_contents, so it might be related to this, we'll keep ticket updated...

comment:9 Changed 2 years ago by spereverde

in combination with collective.actions.delete this indeed breaks the deletion in folder_contents, but I think I can fix that in the package. The main problem we find now is that the fix in PloneTool.py now works for when you try to delete it from the folder_contents, but it doesn't work when you try to delte it via Actions - Delete. So the fix should actually be expanded to include this use case as well...

Last edited 2 years ago by spereverde (previous) (diff)

comment:10 Changed 2 years ago by spereverde

  • Cc gotcha added
  • Status changed from reopened to confirmed

comment:11 Changed 2 years ago by spereverde

  • Owner set to gotcha

comment:12 Changed 2 years ago by spereverde

  • Description modified (diff)

comment:13 Changed 2 years ago by spereverde

  • Description modified (diff)

comment:14 Changed 2 years ago by spereverde

  • fix for this to work in combination with collective.actions.delete was done in  https://github.com/collective/collective.actions.delete/pull/1
  • when working on rewrites this fix also prevents deletion from folder_contents
    • eg. when some.domain.com/plonesitename is rewritten to zope/plonesitename
    • this is because absolute_url_path doesn't take the request into account, so the portal_id (plonesitename) is stripped from the path
    • as in collective.actions.delete, not having the portal_id specified triggers the acquisition warning and prevents the deletion

comment:15 Changed 2 years ago by spereverde

Note: See TracTickets for help on using tickets.