Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3850

@cms.setNode wraps calendars as strings.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 4.4.5
    • freemarker, taglibs
    • None

      Using the setNode tag in a freemarker page, nodeDatas of type (jackrabbit) Date are incorrectly exposed as strings and not as freemarker date.
      Steps to reproduce:

      • create a simple paragraph rendered with freemarker, and a dialog for that paragraph with a control of type date (let's call il "myDate"), and save some date (null-handling is not the point here).
      • create a simple freemarker file (or use the one attached), to render myDate, once just from the implicit object and the other from the same content wrapped by @cms.setNode
      • try to render the paragraph

      Freemarker will say that a date element was expect in the second case, but a string was provided. On further inspection you will find that the calendar is stored in the map as an iso string. As a workaround you can re-parse that string and get back a calendar, but having the original calendar would be much better.
      You may avoid using the setNode, but in some cases is really helpful, expecially in the contentNodeIterator tag, even in freemarker.

      The problem seems connected to the excessive wrapping (freemarker ones and the other provided by the setNode tag), but I wasn't able to find where exactly the problem arises.

        Acceptance criteria

              Unassigned Unassigned
              dfghi Danilo Ghirardelli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD