Recently, I found a Plone object on one of my v3 sites that was locked, could not be deleted (even with admin rights), and could not be viewed; view attempts resulted in a strange page that displayed the Title of the folder in which the object was held, and nothing more. Viewing the folder’s Contents tab displayed the object with the name
[···], which usually indicates that an object was abandoned during the creation stage.
Any attempts to delete this object though the Plone interface, via Contents or the Delete action, resulted in the info message “[object] could not be deleted”. This wasn’t very helpful, as I could see that it wasn’t deleted; I wanted to know why. But the info messages didn’t tell me that, and I couldn’t find anything in the logs either; no error messages were generated.
The ZMI view for the same folder displayed a similar name for the object, but with a padlock icon next to the name, which gave me the very first indication that this object had somehow been locked.
I checked the WebDAV Lock Manager in the ZMI (Control_Panel/DavLocks), which stated that “No locked objects were found.” This was puzzling for two reasons: because the object was clearly locked, and because I was sure that WebDAV had not been used in creating the object (and, therefore, the object lock). I don’t know of any other place in Plone or the ZMI in which to look for locked objects.
At any rate, here’s what I needed to do in order to fix the problem and delete the errant object:
- In Plone, either via the Contents tab for the objects folder or some other location in which the object is visible, right-click the object and copy its URL.
- Paste the URL into your browser’s address bar … but do not press Enter … yet.
- At the end of the URL, change the /view to /edit in order to use the editing template.. If there is no /view trailing the URL, simply add /edit at the end. And then press Enter.
- For some reason, this triggers the information dialog that you should have seen when viewing the object (which seems to indicate a bug in the view template for portal factory objects), and you will be given the option to unlock the object. Click Unlock.
- At this point, you should be able to delete the object either via Actions -> Delete, or by selecting the object in the Contents tab and clicking Delete.