[MAGNOLIA-3850] @cms.setNode wraps calendars as strings. Created: 05/Oct/11  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Magnolia
Component/s: freemarker, taglibs
Affects Version/s: 4.4.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Danilo Ghirardelli Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File example.ftl    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

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.



 Comments   
Comment by Danilo Ghirardelli [ 05/Oct/11 ]

I don't know if this issue belongs here to the generic "freemarker" or is more a part of stk, you can move it if it's in the wrong place.

Comment by Danilo Ghirardelli [ 10/Oct/11 ]

Also Longs are "mapped" as strings, so you can't use them as numbers once the content is wrapped by setNode.

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 03:50:16 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.