Env.parseVariable returns wrong parsed message if default value is used

Description

The iDempiere syntax of the Env.parseVariable method is the following: @Variable:DefaultFallback@. If the “keepUnparseable“ flag is set for the method, it must return the same string (@Variable:DefaultFallback@) if the variable was not found in the context, but currently it returns @Variable@ instead.

It causes problems e.g. with HTML content in mail templates:

Unparsed
<a href=“mailto:info@testemail.com" style="color:#000000" rel="nofollow">info@testemail.com</a>

Parsed (should’ve been the same as unparsed)
<a href=“mailto:info@testemail.com" style="color@testemail.com</a>

Environment

None

Activity

Carlos Ruiz
changed the Status
October 2, 2024 at 9:13 AM
Resolved
Closed
Carlos Ruiz
updated the Fix versions
August 12, 2024 at 3:02 PM
None
11
Carlos Ruiz
changed the Status
August 6, 2024 at 9:01 AM
Open
Resolved
Carlos Ruiz
updated the Resolution
August 6, 2024 at 9:01 AM
None
Fixed
Carlos Ruiz
updated the Fix versions
August 6, 2024 at 9:01 AM
None
12
Peter Takacs
updated the Description
August 5, 2024 at 6:52 AM
The iDempiere syntax of the Env.parseVariable method is the following: @Variable:DefaultFallback@. If the “keepUnparseable“ flag is set for the method, it must return the same string (@Variable:DefaultFallback@) if the variable was not found in the context, but currently it returns @Variable@ instead. It causes problems e.g. with HTML content in mail templates: Unparsed <a href=“[mailto:info@flolivery.sk|mailto:info@flolivery.sk]" style="color:#000000" rel="nofollow">[info@flolivery.sk|mailto:info@flolivery.sk]</a> Parsed (should’ve been the same as unparsed) <a href=“[mailto:info@flolivery.sk|mailto:info@flolivery.sk]" [style="color@flolivery.sk|]</a>
The iDempiere syntax of the Env.parseVariable method is the following: @Variable:DefaultFallback@. If the “keepUnparseable“ flag is set for the method, it must return the same string (@Variable:DefaultFallback@) if the variable was not found in the context, but currently it returns @Variable@ instead. It causes problems e.g. with HTML content in mail templates: Unparsed <a href=“[mailto:info@testemail.|mailto:info@flolivery.sk]com" style="color:#000000" rel="nofollow">[info@testemail.|mailto:info@flolivery.sk]com</a> Parsed (should’ve been the same as unparsed) <a href=“[mailto:info@testemail.|mailto:info@flolivery.sk]com" [style="color@|][testemail.|mailto:info@flolivery.sk]com</a>
Peter Takacs
created the Work item
August 5, 2024 at 6:51 AM
Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created August 5, 2024 at 6:51 AM
Updated October 2, 2024 at 9:13 AM
Resolved August 6, 2024 at 9:01 AM