[MAGNOLIA-3037] Handle UnsupportedOperationException for User implementation within the Freemarker model/wrapper Created: 27/Jan/10  Updated: 23/Jan/13  Resolved: 27/Jan/10

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: None
Fix Version/s: 4.3

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLSTK-568 Revert MGNLSTK-533 for 1.3 Closed
is related to MGNLSTK-727 Freemarker exception for demo-project... Closed
supersession
is superseded by MAGNOLIA-3472 Also handle UnsupportedOperationExcep... 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)

 Description   

When Freemarker templates attempt to output properties out of info.magnolia.cms.security.User instances which throw UnsupportedOperationException}}s (typically {{info.magnolia.cms.security.ExternalUser), this results in ugly exceptions thrown all over the place. Since templates should anyway be aware of this and provide fallback behaviour, our Freemarker wrapper for User could handle those exceptions, giving templates the chance to handle absent properties. They should be able to do user.myProperty!'default value', for example.


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