Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-382

VersionHistoryImpl is incorrectly wrapped as a Node in server-side javascript

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Scripting
    • None

    Description

      The toString() code in this ESP code fails when applied to a versionable Node:

      var history = currentNode.getVersionHistory();
      out.println(history);
      out.write("<br/>");
      out.println(history.toString());
      out.write("<br/>");

      IIUC the cause is that in SlingWrapFactory.wrapAsJavaObject, the jackrabbit VersionHistoryImpl is incorrectly wrapped with a ScriptableNode, as VersionHistoryImpl extends from NodeImpl and there's no specific wrapper for VersionHistoryImpl.

      Attachments

        1. SLING-382.diff
          4 kB
          Gert Vanthienen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bdelacretaz Bertrand Delacretaz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: