Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-21727

AGS - Share RM module is not compatible with Javascript customisation

    Details

    • Bug Priority:
      Category 3
    • ACT Numbers:

      01011748

      Description

      Description

      • The existing Share RM Js class "alfresco-rm-enterprise.js" is not compatible with any changes made to the Array object prototype, for example a change made by a customisation.
        The problem is caused by the use of the for..in iteration (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) which by default iterates over all enumerable properties of the Javascript array. This means that any property added to the Array object prototype is iterated, which can cause issues.

      Supporting evidence

      Steps to reproduce

      • Create a new sdk project, and the following lines to the "documentlist-view-detailed.js" (use the attached file "sdkDemoProject.zip" which is already configured, custom definition can be found at line 486 of the file)
      Array.prototype.insert = function (index, item)
      {
         this.splice(index, 0, item);
      };
      • Run the sdk project and open Share.
      • Login as Admin and create a new Security Group (for example Department) and a new Mark (for example HR)
      • Create "Test" Site of type "Record management"
      • Upload a test file [see attachment "shareAgsUploadedFile.png"]
      • Classify the test file with HR mark

      Expected Behaviour

      • The document is displayed on the folder document list with the "HR" mark

      Observed Behaviour

      • The document is not displayed and there is a Javascript error inside the browser console [see "shareJsError.png"].
        The following stacktrace is thrown within the browser console:
        alfresco-rm-enterprise_4c2449dd7404436463291b97176ac24b.js:116 Uncaught TypeError: groupInfo.marks[j].toUpperCase is not a function
        at Object.Alfresco.rm.renderSecurityMarksBanners (alfresco-rm-enterprise_4c2449dd7404436463291b97176ac24b.js:116)
        at Object.Alfresco.rm.addSecurityControlBanners (alfresco-rm-enterprise_4c2449dd7404436463291b97176ac24b.js:73)
        at Alfresco.rm.DocumentListViewRenderer.Alfresco_rm_DocumentListViewRenderer_renderCellDescription [as renderCellDescription] (rm-documentlist-view-detailed_aef9d83bf3bc07edff2306ebe79feb77.js:41)
        at YAHOO.widget.DataTable.DL_renderCellDescription (documentlist_13e6db2e7b51abf79e544afccc999934.js:1756)
        at YAHOO.widget.DataTable.formatCell (yui-common_5518510ec77ced541930f488625ed9c0.js:66896)
        at YAHOO.widget.DataTable._updateTrEl (yui-common_5518510ec77ced541930f488625ed9c0.js:62621)
        at YAHOO.widget.DataTable._addTrEl (yui-common_5518510ec77ced541930f488625ed9c0.js:62595)
        at YAHOO.widget.DataTable.method (yui-common_5518510ec77ced541930f488625ed9c0.js:64539)
        at yui-common_5518510ec77ced541930f488625ed9c0.js:55523
        

       

      Additional findings

      • Looking at the log the problem is occurring at line 116 of the "alfresco-rm-enterprise.js" file.

        Attachments

        1. sdkDemoProject.zip
          371 kB
        2. shareAgsUploadedFile.png
          shareAgsUploadedFile.png
          509 kB
        3. shareJsError.png
          shareJsError.png
          660 kB

          Structure

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dmondardo Damiano Mondardo
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Structure Helper Panel