Uploaded image for project: 'Magnolia Data Module (closed)'
  1. Magnolia Data Module (closed)
  2. MGNLDATA-125

Missing adminInterface menu under certain condition.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.7.3
    • 1.6.3, 1.7.2
    • None
    • Yes

      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.
      On my system, these steps will often lead to the problem, but not always:

      • create a new type named "z" (without quotes), with a base foder of "/z"
      • create a new subtype for "z", named "a" (without quotes), with the same base folder.
      • export the trees, type nodes and the dialogues for these new types. Do not export adminInterface/config/menu, because it is expected to be recreated if missing.
      • you may logout/login to check that the adminInterface menu was created correctly.
      • restart the webapp.

      You would expect that the adminInterface menu is created again correctly, but often it isn't.
      The problem lays in the DataModule class, lines 186-191:

                      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.
      It's subtle but quite annoying, because there is no way to know which menu will be missing on various installations. Maybe it would be nice to either sort the map having types first, or add the rootPath to the list only if it's not a subtype.

        Acceptance criteria

              mdivilek Milan Divilek
              dfghi Danilo Ghirardelli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: