You are here: Foswiki>Tasks Web>Item1733 (30 Dec 2014, GeorgeClark)Edit Attach

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

pencil
Priority: Low
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: IfStatement
Branches:
Reported By: MichaelDaum
Waiting For:
Last Change By: GeorgeClark
... 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 IfStatement
Priority Low
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic revision: r4 - 30 Dec 2014, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy