Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-71

#stop directive no longer works

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.4-milestone-1
    • Component/s: Velocity
    • Labels:
      None
    • keywords:
      #stop
    • Similar issues:

      Description

      Up to xwiki 2.7, the following velocity section was working ok:

      {{velocity}}
      #set($user=$xwiki.getUser())
      #if(!$user.isUserInGroup("XWiki.XWikiEditorsGroup"))
         {{warning}}You don't have permission to view this document{{/warning}}
         #stop
      #end
      {{/velocity}}
      

      However, as of xwiki 3.0, this code breaks on an exception related to the #stop directive. It appears like the #stop syntax has changed in velocity 1.7 and affects xwiki 3.0 which moved to this new velocity engine.

      I have a workaround for my own pages, but it's probably important to fix this issue since some generic pages (such as default class templates) still use the #stop directive as above and will raise an exception if that code is reached.

        Attachments

          Activity

            People

            Assignee:
            sdumitriu Sergiu Dumitriu
            Reporter:
            china.sunrise@gmail.com China Sunrise
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: