Bug 88039

Summary: Can't delete a folder that has ever had a published item
Product: [Retired] Red Hat Enterprise CMS Reporter: Jon Orris <jorris>
Component: otherAssignee: Justin Ross <jross>
Status: CLOSED RAWHIDE QA Contact: Jon Orris <jorris>
Severity: medium Docs Contact:
Priority: medium    
Version: nightly   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-09 13:46:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 88926    

Description Jon Orris 2003-04-04 20:23:13 UTC
Description of problem:
@29500/Oracle/Resin

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 21:26:59 UTC
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 12:58:35 UTC
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 14:16:38 UTC
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 15:50:07 UTC
I now understand how isDeletable *does* do the right thing :).  I will clarify
that code a bit.

Comment 5 Justin Ross 2003-06-06 23:05:16 UTC
At perforce 32126, I'm not reproducing this bug.  I believe it was fixed by
making auto bundle unpublish work.