[MAGNOLIA-1552] Dialog path not always set via request parameter "mgnlPath" whch throws an NPE on save Created: 24/May/07 Updated: 23/Jan/13 Resolved: 25/May/07 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 3.1 M2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | zam6ak | Assignee: | Philipp Bärfuss |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
3.1-SNAPSHOT |
||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: |
| Description |
|
Steps 1. Edit any user,group, or role and enter some info (like an email address) ERROR org.apache.catalina.core.ContainerBase.[jboss.web].[webdev.nemours.org].[/magnolia-cms].[DialogServlet] 24.05.2007 11:57:10 – Servlet.service() for servlet DialogServlet threw exception |
| Comments |
| Comment by Magnolia International [ 24/May/07 ] |
|
whoever gets to understand the cause of this, please a "when" clause to the subject |
| Comment by zam6ak [ 24/May/07 ] |
|
> whoever gets to understand the cause of this, please a "when" clause to the subject not sure what you ment with this statement, but if the more detailed description of the issue is necessary please lete me know. |
| Comment by Philipp Bracher [ 25/May/07 ] |
|
Can't reproduce on a freshly bootstrapped magnolia. |
| Comment by Magnolia International [ 25/May/07 ] |
|
Amir > nothing more the fact we (eventually) need more precise titles for the fixes to make sense in a changelog. |
| Comment by zam6ak [ 25/May/07 ] |
|
Philipp I just did a fresh build and bootstrap (revision 9555) and I still get the same error. Can you confirm? |
| Comment by zam6ak [ 27/Jul/07 ] |
|
I have some more info regarding this issue. ERROR info.magnolia.module.admininterface.DialogMVCServlet 26.07.2007 19:29:15 – no dialog registered for name: styles/global.css I am not sure why would there be a paragraph for styles/global.css or what is this style sheet being used for but this could be one the problems that is causing the exception |
| Comment by zam6ak [ 17/Aug/07 ] |
|
OK This issue was really starting to annoy me so I decided to take a look into the code and here is what I found out. info.magnolia.module.admininterface.DialogMVCHandler.getStorageNode() on line 305 passed a "path" String to HierarchyMaanger in order to get content. path is defined as protected String path = StringUtils.EMPTY; so it should not be null but in the constructor it is being reset by a method from RequestFormUtil path = params.getParameter("mgnlPath"); which could reset it to null (not only path but other fields as well) The problem seems to be that at no point there is a check if this parameter is not null....And the "mgnlPath" request parameter is not always being set it seems. I believe info.magnolia.cms.core.DefaultHierarchyManager.getContent() should throw NPE but info.magnolia.module.admininterface.DialogMVCHandler.getStorageNode() should check if this parameter is null AND if its value is something meaningful... So on line 305 of info.magnolia.module.admininterface.DialogMVCHandler there should be something like: if (this.path == null) { |
| Comment by zam6ak [ 17/Aug/07 ] |
|
| Comment by Philipp Bracher [ 21/Aug/07 ] |
|
mgnlPath should be set in any case. Sure we can do additional exception handling, but there is no valid default value. All we achieve is a path not found exception instead. |
| Comment by Philipp Bracher [ 21/Aug/07 ] |
|
Added a check and a warn log which logs the original URL. |
| Comment by zam6ak [ 21/Aug/07 ] |
|
Is it possible to also get the dialog name (or path) in the message? |
| Comment by Philipp Bracher [ 21/Aug/07 ] |
|
dialog name is part of the url |
| Comment by zam6ak [ 22/Aug/07 ] |
|
Ok now when I open roles dialog and just click save I get: WARN info.magnolia.module.admininterface.DialogMVCHandler DialogMVCHandler.java(getStorageNode:306) 22.08.2007 09:20:12 No path defined for a dialog called by the url http://mypc.mycompany.org/magnoliaAuthor/.magnolia/dialogs/roleedit.html |