Bug 88039 - Can't delete a folder that has ever had a published item
Summary: Can't delete a folder that has ever had a published item
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise CMS
Classification: Retired
Component: other
Version: nightly
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Justin Ross
QA Contact: Jon Orris
URL:
Whiteboard:
Depends On:
Blocks: 88926
TreeView+ depends on / blocked
 
Reported: 2003-04-04 20:23 UTC by Jon Orris
Modified: 2007-04-18 16:52 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-06-09 13:46:07 UTC
Embargoed:


Attachments (Terms of Use)

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.


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