$body always defined for user macros

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 1.4.2
    • Affects Version/s: 1.4.1
    • Component/s: None

      We have a user macro defined as follows:

      <a href="$req.contextPath/../confluence-files/$param0">
      #if ($body)
      $body
      #else
      $param0
      #end
      </a>

      The macro is used to link to an arbitrary page / file in another path on the same server. It can either be used as

      {file:foo} or {file:foo}bar{file}

      .

      The

      {file:foo}

      usage worked fine in Confluence 1.3.x as the #if ($body) test evaluated to false. In Confluence 1.4.1, however, this test seems to evaluate to true, even though the macro was not passed a body.

      I am not sure if this is a bug or not. I am sure we can work around this by comparing $body to the empty string. I just noticed that Confluence had changed here.

              Assignee:
              Unassigned
              Reporter:
              knut_wannheden
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: