Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-33964

IF Statement Always Returns TRUE In User Macro

XMLWordPrintable

      In User Macro (template), the IF statement always returns true.

      Steps to Replicate

      1. Create a simple Rendered User Macro with the following sample template:
        ## @param PM:type=boolean
        #if($paramPM)
        PM is <b>true</b>
        #else
        PM is <b>false</b>
        #end
        
      2. Insert the user macro in a page
      3. In the Macro Editor, the default state of the checkbox is unticked
      4. Save the page
      5. The page shows 'PM is true' instead of 'PM is false'

      Workaround
      Define the default value of parameter in the IF statement:

      ## @param PM:type=boolean
      #if($paramPM == "true")
      PM is <b>true</b>
      #else
      PM is <b>false</b>
      #end
      

              Unassigned Unassigned
              prompas Patrice Rompas (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: