NPE at at er.modern.directtoweb.components.buttons.ERMDRemoveRelatedButton.showRemoveButton(ERMDRemoveRelatedButton.java:197) with isEntityDeletable=false
NPE at at er.modern.directtoweb.components.buttons.ERMDRemoveRelatedButton.showRemoveButton(ERMDRemoveRelatedButton.java:197) with isEntityDeletable=false
- Subject: NPE at at er.modern.directtoweb.components.buttons.ERMDRemoveRelatedButton.showRemoveButton(ERMDRemoveRelatedButton.java:197) with isEntityDeletable=false
- From: Johan Henselmans <email@hidden>
- Date: Thu, 23 Dec 2010 18:09:16 +0100
Just to warn some people that might get caught in the same corner.
I was happily testing rules on NavigationMenu.plists and a new DateTimePicker component, when I got at strange message when I tried to edit a relation from an entity.
The thing was a n-1 relation, nothing special (a location where a performance might take place). When I tried to select a location, the ModernDirectToWeb would crash.
I first thought it had to do with some error in the EOModel, and noticed that there were a lot of the properties of the Location entity flagged as being part of a client class. Removed them, no dice. To make a few hours search short (like completely rebuilding the app with the navigation menu stripped etc. I found out what is was.
I had set up a rule
if session.isAdmin => isEntityDeletable= true,
and the accompanying rule
true=> isEntityDeletable=false
As I was trying to replace this stuff with a role based structure, I had all forgotten about it, and the session.isAdmin was disabled, so nothing should be deletable.
When I enabled
isEntityDeletable=true
the crashes stopped.
Apparently, if you have an entity that can be created and where relations can be created, then ERModernDirectToWeb assumes that it should also be able to remove these relations, and that collided with the isEntityDeletable rule.
Johan Henselmans
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden