Hi Andrea,

this method doesn't make any guarantee in regard of persisting the changes so 
I'd say it works as expected. 

You can always get hierarchy manager for given workspace from content itself 
before passing it in the method and then persist the change by calling save() 
on hierarchy manager directly.

HTH,
Jan

On Dec 4, 2012, at 12:38 PM, Andrea Castelli <[email protected]> 
wrote:

> Hi guys,
> in info.magnolia.cms.util.ContentUtil there is the following method that 
> doesn't call parent.save();
> As result nothing is deleted.
> 
>  public static void deleteAndRemoveEmptyParents(Content node, int level) 
> throws PathNotFoundException, RepositoryException,
>         AccessDeniedException {
>         Content parent = null;
>         if(node.getLevel() != 0){
>              parent = node.getParent();
>         }
>         node.delete();
>         if(parent != null && parent.getLevel()>level && 
> parent.getChildren(ContentUtil.EXCLUDE_META_DATA_CONTENT_FILTER).size()==0){
>             deleteAndRemoveEmptyParents(parent, level);
>         }
>     }
> 
> Is this a bug or am I using the method in bad way?
> 
> Bye.
> Andrea Castelli
> 
> 
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------




----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to