[MAGNOLIA-3761] Wrong condition tested for the save label in Dialog class Created: 18/Jul/11  Updated: 16/Aug/11  Resolved: 21/Jul/11

Status: Closed
Project: Magnolia
Component/s: admininterface
Affects Version/s: 4.4.4
Fix Version/s: 4.4.5

Type: Bug Priority: Neutral
Reporter: Danilo Ghirardelli Assignee: Daniel Lipp
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File patch.diff    
Template:
Patch included:
Yes
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   

I stumbled upon this while doing some extension for a project.
Class Dialog, lines 260-261:

        String saveLabel = this.getConfigValue("saveLabel", msgs.get("buttons.save"));
        if (StringUtils.isNotEmpty(saveOnclick) && StringUtils.isNotEmpty("saveLabel")) {

Seems alright, but in the second isNotEmpty, the string tested is not saveLabel as a variable, but as the string itself. Obviously that condition will always be true, leading potential problems to the following code.
Simple patch is attached.



 Comments   
Comment by Jan Haderka [ 19/Jul/11 ]

Thanks for patch.

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