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

Wrong condition tested for the save label in Dialog class

    XMLWordPrintable

Details

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

    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.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD