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

call to guessMimetype() on a node that has no content creates a content property

    Details

    • Type: Service Pack Request
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 4.2.2
    • Fix Version/s: 4.2.5
    • Component/s: ACS JavaScript API
    • Labels:
      None
    • Environment:
      linux pg tomcat

      Description

      How to reproduce?
      =================
      1) create a plain vanilla 3.4.10 (linux pg tomcat)
      2) create a site 'site1' in Share as admin
      3) create a folder 'folder1' in 'site1' document library
      4) create in '/Company Home/Data Dictionary/Scripts' a file 'alex1.js' that contains:

      ----------alex1.js-------
      var folder = companyhome.childByNamePath("/Sites/site1/documentLibrary/folder1");
      var anode = folder.createNode("test1.txt", "cm:content");
      anode;
      ----------------------------

      This script creates a node that has no content.

      5) execute the script going (as admin) to:
      http://localhost:8080/alfresco/command/script/execute?scriptPath=/Company Home/Data Dictionary/Scripts/alex1.js

      6) get the node details from the node browser (see attachment node1.html) and confirm it has not 'content'.

      7) create in '/Company Home/Data Dictionary/Scripts' a file 'alex2.js' that contains:

      ----------alex2.js-------
      var anode = companyhome.childByNamePath("/Sites/site1/documentLibrary/folder1/test1.txt");
      anode.properties.content.guessMimetype("test1.txt");
      anode.save();
      ----------------------------

      8) execute the script going (as admin) to:
      http://localhost:8080/alfresco/command/script/execute?scriptPath=/Company Home/Data Dictionary/Scripts/alex2.js

      9) get the node details from the node browser (see attachment node2.html)

      Result:
      =====
      calling the guessMimetype() method added a new property to the node.

      Expected result:
      ===============
      calling the guessMimetype() method on a node that has no content should not create a content.

        Attachments

        1. alex1.js
          0.3 kB
        2. alex2.js
          0.2 kB
        3. node1.html
          16 kB
        4. node2.html
          17 kB

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  amadon Alex Madon [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 4 days, 4 hours
                    4d 4h

                      Structure Helper Panel