Bug 88039 - Can't delete a folder that has ever had a published item
Can't delete a folder that has ever had a published item
Product: Red Hat Enterprise CMS
Classification: Retired
Component: other (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Justin Ross
Jon Orris
Depends On:
Blocks: 88926
  Show dependency treegraph
Reported: 2003-04-04 15:23 EST by Jon Orris
Modified: 2007-04-18 12:52 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-06-09 09:46:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jon Orris 2003-04-04 15:23:13 EST
Description of problem:

Create a folder
Add an item to the folder
Publish item
Unpublish item
Delete item

The delete link does not show up for the folder, though it is empty. This
problem does not occur if you delete the item before publication.
Comment 1 Justin Ross 2003-06-03 17:26:59 EDT
Jon, I'm confused about this ticket.  As far as I can tell, since way way back,
folders are not deletable:

    public boolean isDeletable() {                                             
        if ( m_itemColl.isLive() ) {                                           
            return false;                                                      
        return ! ( m_itemColl.isFolder() )                                     
            || ((Folder) m_itemColl.getContentItem()).isEmpty();               

So, shall I try to enable folder deletes?
Comment 2 Richard Li 2003-06-04 08:58:35 EDT
I think that from a usability perspective, it makes sense to allow folders to be
deleted. I asked Mr Berrange on IRC:

<danpb>	live folders are automatically deleted when the last live item in them
is removed
<danpb>	then you need to delete all draft items in the folder, at which point a
link to delete the draft folder will appear in the 'browse' pane

The convoluted isDeletable code actually makes sense. The first if says "if it
is live, it is not deletable". The second has two parts: "if it is not a folder,
it is deletable" and "if it is a folder and is empty, it is deletable". So this
part is correct, albeit confusing.
Comment 3 Scott Seago 2003-06-04 10:16:38 EDT
This might have something to do with the fact that Bundles are never
unpublished. When the last lang instance of a bundle is unpublished, the Bundle
should be unpublished. Currently when a live folder is emptied, the live version
is unpublished (allowing deletion). When bundles are never unpublished, neither
are folders.
Comment 4 Justin Ross 2003-06-04 11:50:07 EDT
I now understand how isDeletable *does* do the right thing :).  I will clarify
that code a bit.
Comment 5 Justin Ross 2003-06-06 19:05:16 EDT
At perforce 32126, I'm not reproducing this bug.  I believe it was fixed by
making auto bundle unpublish work.

Note You need to log in before you can comment on or make changes to this bug.