Uploaded image for project: 'Alfresco'
  1. Alfresco
  2. ALF-20384

widgetUtils.deleteObjectFromArray does not properly delete - menu fail to render

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 4.2.e Community
    • Fix Version/s: None
    • Component/s: Web Scripts and Surf
    • Security Level: external (External user)
    • Labels:
      None

      Description

      If using the method described by Daves blog post to delete a menu item, the menu rendering fail with client side error. Menu is not shown at all.

      Using
      widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_MY_FILES");
      will result in an array with a null object.
      Code errors out in:

                  array.forEach(this.widgets, function(entry, i) {
                     if (entry.config && entry.config.label)
                     {
                        entry.config.label = _this.message(entry.config.label);
                     }
                  });
      

      The array this.widgets is null in position 1, you would expect this position to be completely deleted (and not nulled).

      Workaround is to use native js function to remove as found in ALF-19930.

        Attachments

          Structure

            Activity

              People

              • Assignee:
                closedissues Closed Issues
                Reporter:
                loftux Peter Löfgren
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response:

                  Structure Helper Panel