Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3761

Wrong condition tested for the save label in Dialog class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 4.4.5
    • 4.4.4
    • admininterface
    • None

      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.

        Acceptance criteria

              dlipp Daniel Lipp
              dfghi Danilo Ghirardelli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD