[MGNLDATA-125] Missing adminInterface menu under certain condition. Created: 04/Jul/11 Updated: 25/Mar/13 Resolved: 24/Jul/12 |
|
| Status: | Closed |
| Project: | Magnolia Data Module (closed) |
| Component/s: | None |
| Affects Version/s: | 1.6.3, 1.7.2 |
| Fix Version/s: | 1.7.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Danilo Ghirardelli | Assignee: | Milan Divilek |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Template: |
|
| Patch included: |
Yes
|
| Acceptance criteria: |
Empty
|
| Date of First Response: |
| Description |
|
There is a problem that prevents to generate the data menu correctly in some cases, but I haven't yet found a way to always reproduce it, because it depends deeply on the order in which types are registered, which is not guaranteed.
You would expect that the adminInterface menu is created again correctly, but often it isn't. if(!allRootPaths.contains(type.getRootPath())) { allRootPaths.add(type.getRootPath()); // create rootPath and a menu entry for each if necessary createRootPath(type); updateDataMenu(type); } If you check the code you'll see that "types" are considered all at the same level, because they are stored in a map. If for any reason a subtype is returned by the map before its parent, these lines will add the root path to the list, but the "updateDataMenu" will skip the menu creation because it is a subtype. When the type is returned by the map, the root path is already in the list and it's skipped, so the menu is not created. |
| Comments |
| Comment by Danilo Ghirardelli [ 04/Jul/11 ] |
|
As a simple workaround you can export the generated adminInterface menu config and force you code to import that, but it would be nice to have the module do its work correctly. |
| Comment by Danilo Ghirardelli [ 04/Oct/11 ] |
|
The attached patch corrects the problem in one direction: if a subtype is processed before its parent, the path is not added until the parent is processed, this way you are sure that all the menus are created. |
| Comment by Jan Haderka [ 19/Jul/12 ] |
|
Test? |