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

#stop directive no longer works

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 3.4-milestone-1
    • 3.0
    • Velocity
    • None
    • #stop

    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

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

            Dates

              Created:
              Updated:
              Resolved: