NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item1733: %PARAMs can't be used in %IFs

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Low Confirmed Engine    
... because they are not added as preference variables. They are substituted into the message as is which is too late in the parsing order for other tags like %IF to read them.

Try this:
%IF{
  "'%PARAM1%.%PARAM2%'='%TRASHWEB%.TrashAttachment'"
  then="this is a DELETE"
  else="this is a MOVE"
}%

Doesn't work. I tried to figure out how to fix that and found out that the %PARAM values are added to oopses and error messages in quite different places. Confusing. Anybody else a clue?

-- MichaelDaum - 16 Jun 2009

Oh, I got this working using
%IF{
  "'%URLPARAM{param1}%.%URLPARAM{param2}%'='%TRASHWEB%.TrashAttachment'"
  then="this is a DELETE"
  else="this is a MOVE"
}%

Foswiki is so so strange sometimes

-- MichaelDaum - 16 Jun 2009

Isn't this handled with the %IF{"$ MACRO syntax, or %IF{"$ urlparam ? Can we set this to No Action?

-- GeorgeClark - 16 Mar 2011

That does not really matter. The point is that %IF{...%PARAM...} isn't parse inside-out-left-to-right because %PARAMs are no first class citizens.

-- MichaelDaum - 17 Mar 2011

ItemTemplate edit

Summary %PARAMs can't be used in %IFs
ReportedBy MichaelDaum
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Low
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r3 - 17 Mar 2011, MichaelDaum
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads