Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2627

Allow set to null in velocity

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 2.2 M1
    • 1.5
    • Velocity
    • None
    • Unit
    • Trivial

    Description

      By default velocity does not allow set to null. For example this script:

      
      #if(!$a)
      * Variable a does not exist and this is normal
      #else
      * Variable a exist and this is not normal
      #end
      
      #set($a = "1")
      
      #if(!$a)
      * Variable a exist and this is normal
      #else
      * Variable a does not exist and this is not normal
      #end
      
      #set($a = $xwiki.null)
      
      #if(!$a)
      * Variable a does not exist and this is normal
      #else
      * Variable a exist and this is not normal
      #end
      

      But apparently this can be fixed by adding this to velocity.properties (in xwiki 1.5 this will have to be done differently)

      directive.set.null.allowed = true

      Attachments

        Issue Links

          Activity

            People

              sdumitriu Sergiu Dumitriu
              ludovic Ludovic Dubost
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: