[pmwiki-users] ZAPdata savedata question
Lucian Wischik
lu.gmane at wischik.com
Sun Nov 19 05:35:01 CST 2006
William Cole <eric <at> wanderinglighthouse.com> writes:
> What I'm running into is that the (:input hidden savedata ......:)
> saves the data whether or not the condition of the (:if :)body
> (:ifend:), where it resides, is met.
> Any tips, comments or pointers?
>
> (:if equal {$MyAction} "View" :)
> (:include Forms.ContactView:)
> (:ifend:)
I recently ran into something vaguely similar. I used
(:if ...:) (:skin pmwiki:) (:ifend:)
The issue was the order in which pmwiki processes markup.
It happens that it processes the (:skin:) markup first,
before the (:if:). And the (:skin:) markup has a side
effect when it gets processed. So this effect will happen
whether or not the condition is met.
I wonder if you're encountering something similar? For instance,
if your included Forms.ContactView itself has a conditional,
and if (:include:) gets processed before (:if:), then your
three lines above might expand into
(:if equal browse "View" :)
something
(:if test:)
button
(:ifend:)
(:ifend:)
and my guess is that pmwiki will choke on this.
What's the solution? In my case I instructed my (:skin:)
markup to execute a little later. But it's not really
a good general solution. The general solution? move away
from regexps and towards a clean lazy typed higher-order functional
language :) which of course is never going to happen.
--
Lucian
More information about the pmwiki-users
mailing list