Unlocking locked Plone objects

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.

A Plone object abandoned during creation.

A Plone object abandoned during creation.

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 Plone DAV lock 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:

  1. 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.
  2. Paste the URL into your browser’s address bar … but do not press Enter … yet.
  3. 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.
  4. 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.
  5. 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.
Advertisements

4 thoughts on “Unlocking locked Plone objects

  1. Pingback: More fun with Plone locks « A DeStefano Blog

  2. Just to leave a note that this site really helped me get over a jam on my job. Thanks for the clear explanation on how to unlock locked objects

  3. After going over a number of the blog posts on
    your website, I seriously appreciate your technique
    of blogging. I bookmarked it to my bookmark
    webpage list and will be checking back soon. Please check out my website as
    well and let me know your opinion.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s