[MAGNOLIA-3472] Also handle UnsupportedOperationException for User implementation within the Freemarker model/wrapper when templates calls the getProperty method directly. Created: 17/Dec/10  Updated: 19/Dec/16  Resolved: 04/Nov/15

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

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File MAGNOLIA-3472-failingtest.patch    
Issue Links:
supersession
supersedes MGNLSTK-727 Freemarker exception for demo-project... Closed
supersedes MAGNOLIA-3037 Handle UnsupportedOperationException ... Closed
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)
Date of First Response:

 Description   

The info.magnolia.freemarker.models.UserModel is written to "hide" the UnsupportedOperationException (since MAGNOLIA-3037) only when using user.fullName - which gets interpreted as user.getProperty("fullName").

Some of our templates still do user.getProperty("fullName"), and that falls out of the try/catch block of UserModel.



 Comments   
Comment by Magnolia International [ 17/Dec/10 ]

Not actually as easy to fix as I hoped. info.magnolia.freemarker.models.UserModel returns a SimpleMethodModel for key getProperty, which gets executed later, so moving the try statement a few lines up is useless.

As far as I can tell, only one our templates is impacted, how about simply fixing that instead ?

Comment by Magnolia International [ 17/Dec/10 ]

here's a failing test if anyone wants to tackle this. Now that the template is fixed, probably not so crucial.

Comment by Philipp Bärfuss [ 18/Jan/11 ]

We are finalizing 4.4.2 hence I am moving this issue to 4.4.3.

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:46:48 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.