You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Will Glass-Husain (JIRA)" <ji...@apache.org> on 2005/09/18 23:01:54 UTC

[jira] Updated: (VELOCITY-71) False positive error condition parsing VM_global_library.vm

     [ http://issues.apache.org/jira/browse/VELOCITY-71?page=all ]

Will Glass-Husain updated VELOCITY-71:
--------------------------------------

    Bugzilla Id:   (was: 8716)
    Fix Version: 1.5
    Description: 
This bug is actually against 1.3 RC1, but there is no Version listing for that
in the Bugzilla config.

The initial parsing of the global Velocimacro library is incorrectly indicating
an error when context variables which are not passed in as arguments to a macro
are used when calling one macro within the body of another.  Confusing, eh?  I
assume that this could be worked around by putting double quotes around the
supposedly non-existent arguments to the invoked macro, but was wondering if
this was a bug.  Included is a sample problem case and some log output.

>From VM_global_library.vm:

#macro(linkedLoginName $acl $user)
 #linkIf($user.isEditableBy($acl) $currentDomain.getProjectPageURL("UserEdit",
"userID=$user.getID()") $user.getLoginName()) 
#end

#macro(linkIf $condition $link $text)
 #if ($condition) <a href="$link">$text</a> #else $text #end
#end

>From velocity.log:

2002-05-01 15:04:28,496 - Velocimacro : added new VM : #enterHelp( filename
linktext ) : source = VM_global_library.vm
2002-05-01 15:04:28,843 - VM #linkIf: error : too few arguments to macro. Wanted
3 got 0
2002-05-01 15:04:28,847 - VM #servletLink: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,848 - VM #servletLink: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,849 - VM #servletLink: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,857 - VM #displayProjectTreeAsOptions: error : too few
arguments to macro. Wanted 4 got 0
2002-05-01 15:04:28,907 - VM #selectYear: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,907 - VM #selectMonth: error : too few arguments to macro.
Wanted 1 got 0
2002-05-01 15:04:28,908 - VM #selectDay: error : too few arguments to macro.
Wanted 1 got 0
2002-05-01 15:04:29,109 - ResourceManager : found VM_global_library.vm with
loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
2002-05-01 15:04:29,113 - Velocimacro :  VM library template macro registration
complete.
2002-05-01 15:04:29,113 - Velocimacro : allowInline = true : VMs can be defined
inline in templates

  was:
This bug is actually against 1.3 RC1, but there is no Version listing for that
in the Bugzilla config.

The initial parsing of the global Velocimacro library is incorrectly indicating
an error when context variables which are not passed in as arguments to a macro
are used when calling one macro within the body of another.  Confusing, eh?  I
assume that this could be worked around by putting double quotes around the
supposedly non-existent arguments to the invoked macro, but was wondering if
this was a bug.  Included is a sample problem case and some log output.

>From VM_global_library.vm:

#macro(linkedLoginName $acl $user)
 #linkIf($user.isEditableBy($acl) $currentDomain.getProjectPageURL("UserEdit",
"userID=$user.getID()") $user.getLoginName()) 
#end

#macro(linkIf $condition $link $text)
 #if ($condition) <a href="$link">$text</a> #else $text #end
#end

>From velocity.log:

2002-05-01 15:04:28,496 - Velocimacro : added new VM : #enterHelp( filename
linktext ) : source = VM_global_library.vm
2002-05-01 15:04:28,843 - VM #linkIf: error : too few arguments to macro. Wanted
3 got 0
2002-05-01 15:04:28,847 - VM #servletLink: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,848 - VM #servletLink: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,849 - VM #servletLink: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,857 - VM #displayProjectTreeAsOptions: error : too few
arguments to macro. Wanted 4 got 0
2002-05-01 15:04:28,907 - VM #selectYear: error : too few arguments to macro.
Wanted 2 got 0
2002-05-01 15:04:28,907 - VM #selectMonth: error : too few arguments to macro.
Wanted 1 got 0
2002-05-01 15:04:28,908 - VM #selectDay: error : too few arguments to macro.
Wanted 1 got 0
2002-05-01 15:04:29,109 - ResourceManager : found VM_global_library.vm with
loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
2002-05-01 15:04:29,113 - Velocimacro :  VM library template macro registration
complete.
2002-05-01 15:04:29,113 - Velocimacro : allowInline = true : VMs can be defined
inline in templates

    Environment: 
Operating System: Linux
Platform: Other

  was:
Operating System: Linux
Platform: Other

      Assign To:     (was: Velocity-Dev List)

It'd be nice to fix this for 1.5 release

> False positive error condition parsing VM_global_library.vm
> -----------------------------------------------------------
>
>          Key: VELOCITY-71
>          URL: http://issues.apache.org/jira/browse/VELOCITY-71
>      Project: Velocity
>         Type: Bug
>   Components: Source
>     Versions: 1.0-Release
>  Environment: Operating System: Linux
> Platform: Other
>     Reporter: Daniel Rall
>      Fix For: 1.5

>
> This bug is actually against 1.3 RC1, but there is no Version listing for that
> in the Bugzilla config.
> The initial parsing of the global Velocimacro library is incorrectly indicating
> an error when context variables which are not passed in as arguments to a macro
> are used when calling one macro within the body of another.  Confusing, eh?  I
> assume that this could be worked around by putting double quotes around the
> supposedly non-existent arguments to the invoked macro, but was wondering if
> this was a bug.  Included is a sample problem case and some log output.
> From VM_global_library.vm:
> #macro(linkedLoginName $acl $user)
>  #linkIf($user.isEditableBy($acl) $currentDomain.getProjectPageURL("UserEdit",
> "userID=$user.getID()") $user.getLoginName()) 
> #end
> #macro(linkIf $condition $link $text)
>  #if ($condition) <a href="$link">$text</a> #else $text #end
> #end
> From velocity.log:
> 2002-05-01 15:04:28,496 - Velocimacro : added new VM : #enterHelp( filename
> linktext ) : source = VM_global_library.vm
> 2002-05-01 15:04:28,843 - VM #linkIf: error : too few arguments to macro. Wanted
> 3 got 0
> 2002-05-01 15:04:28,847 - VM #servletLink: error : too few arguments to macro.
> Wanted 2 got 0
> 2002-05-01 15:04:28,848 - VM #servletLink: error : too few arguments to macro.
> Wanted 2 got 0
> 2002-05-01 15:04:28,849 - VM #servletLink: error : too few arguments to macro.
> Wanted 2 got 0
> 2002-05-01 15:04:28,857 - VM #displayProjectTreeAsOptions: error : too few
> arguments to macro. Wanted 4 got 0
> 2002-05-01 15:04:28,907 - VM #selectYear: error : too few arguments to macro.
> Wanted 2 got 0
> 2002-05-01 15:04:28,907 - VM #selectMonth: error : too few arguments to macro.
> Wanted 1 got 0
> 2002-05-01 15:04:28,908 - VM #selectDay: error : too few arguments to macro.
> Wanted 1 got 0
> 2002-05-01 15:04:29,109 - ResourceManager : found VM_global_library.vm with
> loader org.apache.velocity.runtime.resource.loader.FileResourceLoader
> 2002-05-01 15:04:29,113 - Velocimacro :  VM library template macro registration
> complete.
> 2002-05-01 15:04:29,113 - Velocimacro : allowInline = true : VMs can be defined
> inline in templates

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org