[MGNLDATA-151] ItemTypes cannot be deleted when their "rootPath" is not on the top level Created: 05/May/12  Updated: 24/May/12  Resolved: 14/May/12

Status: Closed
Project: Magnolia Data Module (closed)
Component/s: None
Affects Version/s: 1.6.4, 1.7.1
Fix Version/s: 1.7.2

Type: Bug Priority: Neutral
Reporter: Will Scheidegger Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: delete, itemtype, nodetype
Remaining Estimate: 0.5h
Time Spent: Not Specified
Original Estimate: 0.5h

Attachments: Text File itemsExist.patch    
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Date of First Response:

 Description   

If you have defined a data node type which has its root on level > 1 you'll get a NPE when trying to delete the item type.

{{2012-05-05 07:04:18,637 ERROR fo.magnolia.module.data.commands.TypeDeleteCommand: cannot do delete
java.lang.NullPointerException
at info.magnolia.module.data.commands.TypeDeleteCommand.itemsExist(TypeDeleteCommand.java:119)}}

This is caused by the use of (deprecated) .getChildByName() which of course does not work for something like "/customer/products".

The attached patch uses ContentUtil.getContent(repository, path) instead and therefore also works with nested root nodes.



 Comments   
Comment by Ondrej Chytil [ 07/May/12 ]

Also issue for trunk version - added to 4.5.3 changelog.
Thanks for reporting Will.

Comment by Milan Divilek [ 14/May/12 ]

Commit message, Commit message

Generated at Mon Feb 12 05:11:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.