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

Cannot retrieve cm:title from an avm node in freemarker (if persisted with actual type as MLText)

    Details

    • Type: Service Pack Request
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.2.1
    • Component/s: ZZ_Archive
    • Labels:
      None
    • Bug Priority:
      Category 2
    • ACT Numbers:

      15268, 16063

      Description

      Using this webscript:

      *********
      testGetTitle();

      function testGetTitle()

      { var uniquePath = args.uniquePath; model.avmNode = avm.lookupNode(uniquePath); }

      **

      <testing>
      <name>${avmNode.properties["cm:name"]}</name>
      <title>${avmNode.properties["cm:title"]}</title>
      </testing>
      ***********

      You will get this error:

      500 Internal Error An error inside the HTTP server which prevented it from fulfilling the request. Wrapped Exception (with status template): Error during processing of the template 'Error on line 4, column 14 in foo/testing/foo.title.get.xml.ftl Expecting a string, date or number here, Expression avmNode.properties["cm:title"] is instead a freemarker.template.SimpleHash'. Please contact your system administrator. org.alfresco.web.scripts.WebScriptException - Wrapped Exception (with status template): Error during processing of the template 'Error on line 4, column 14 in foo/testing/foo.title.get.xml.ftl Expecting a string, date or number here, Expression avmNode.properties["cm:title"] is instead a freemarker.template.SimpleHash'. Please contact your system administrator.

      All works well if you remove the title reference and there is indeed a title property on this node.

      This can be worked around by getting the title in the jscript first:

      *************
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <testing>
      <name>${name}</name>
      <title>${title}</title>
      </testing>

      **
      testGetTitle();
      function testGetTitle()

      { logger.log("path: " + args.uniquePath); var node = avm.lookupNode(args.uniquePath); logger.log("node name: " + node.name); logger.log("node title: " + node.properties.title); model.name = node.name; model.title = node.properties.title; }

      ************

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  jjaquette John Jaquette [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Structure Helper Panel