[pmwiki-users] fox permissions problem after upgrade

Hans Bracker design at softflow.co.uk
Thu Jan 17 03:47:54 CST 2013

Hello Adam,

I notice these parts of your Fox form:

(:fox cbox ... target="{$$year}{$$month}{$$day}" ...:)
(:cell width=5%:){$InputSelect_month}
(:cell width=5%:){$InputSelect_day}
(:cell width=5%:){$InputSelect_year}

I do not notice any input fields named 'year', 'month', 'day'.
I would normally expect those for use in the replacement variables
{$$year}, {$$month}, {$$day}.
But your HTML source shows input select tags with those names, so
somehow you defined page variables  {$InputSelect_month} etc. to be
rendered as these input tags. So that seems not the culprit.

What puzzles me is that  target="{$$year}{$$month}{$$day}"
is not rendered as
<input type='hidden' name='target' value='{$$year}{$$month}{$$day}' />
These variables are stripped out. Why? The fox markup does not do
that as far as I know.
Can you confirm this perhaps by creating a short Fox test form in a
sandbox page, for instance:

(:fox frm template=#tmpl testtarget="{$$year}{$$month}{$$day}" :)
Y:(:input text year:) M:(:input text month:) D:(:input text day:)
(:input hidden foxfilter correctDate:)
(:input submit post:)
(:foxend frm:)
(:if false:)
Test: {$$testtarget}

This form does not create a page target, instead it posts to the same
page. 'testtarget' is a hidden input similar to 'target' though, and
one should see how the variables are used.
Is '{$$year}{$$month}{$$day}' missing in the HTML source?

Would be nice to know what causes stripping of the {$$variables} in
the HTML rendering. Perhaps your upgrading has to do with this.
There was a change in PmWiki regards undefined template variables,
but I am not sure if that could have any bearing on your problem. See
change in Version 2.2.14 and this:
Ah, I see now!
You could add to config.php
  $EnableUndefinedTemplateVars = 1;
We need to explicitely allow undefined variables of the type {$$var},
if we use (:include ...:) markup to include Fox forms.
To avoid this problem of having to set $EnableUndefinedTemplateVars
(because undefined template variables may be desirable to hav eNOT
shown) Fox got its very own markup to load a Fox form from another
page: instead of (:include ... :) you can use this:
(:foxform ... :) specifying the form page or page section.
See http://softflow.co.uk/design/FoxDocumentation/FoxMarkup#foxform

Best regards,
mailto:design at softflow.co.uk

More information about the pmwiki-users mailing list