[pmwiki-users] (:input default source=...:) not using $DefaultUnsetPageTextVars?...
Petko Yotov
5ko at 5ko.fr
Mon Jul 25 04:24:21 PDT 2022
Thanks for the report.
Indeed, (:input default source=...:) does not currently work with
$DefaultUnsetPageTextVars and $DefaultEmptyPageTextVars.
These 2 variables work the normal way PmWiki retrieves the value of a
page text variable, by page and variable name.
The (:input default source=...:) works the other way around, it
retrieves all existing page text variables from the source page, and
adds them to the $InputValues array. It doesn't request individual
variables that can be intercepted and defined when unset or empty.
One difficulty to add the $DefaultUnsetPageTextVars entries to the
$InputValues array is the former may contain wildcard characters like ?
or *, and the latter need to be precisely defined / fixed.
I have added non-wildcard entries from $DefaultUnsetPageTextVars and
$DefaultEmptyPageTextVars to unset or empty entries of the $InputValues
array. This should be available for 2.3.9 next month.
You can download a nightly release, or a partial export from:
https://www.pmwiki.org/wiki/PmWiki/ChangeLog
(Only the file scripts/forms.php changed.)
If you do test it, please report if something is not right.
Petko
--
PmWeekly Blog : https://www.pmwiki.org/News
If you upgrade : https://www.pmwiki.org/Upgrades
На 25/07/2022 12:29, pmwiki.johnny1000 at spamgourmet.com написа:
> I don't seem to be able to set a control's default value from
> $DefaultUnsetPageTextVars, when either the source page does not exist,
> or the PTV is not defined on the source page:
> (When the PTV is defined on the source page, the control's default
> value is set as expected.)
>
> (:input default source=Main.DataPage:)
> (:input text name=$:ptv:)
>
> If either the source page does not exist, or the PTV is not defined on
> the source page, I have to use the following code:
> (This sets the control's default value from $DefaultUnsetPageTextVars
> as expected.)
>
> (:input default {$:ptv} Main.DataPage$:{$:ptv}:)
> (:input text name={$:ptv}:)
>
> Is there something I have not understood about (:input default
> source=...:) + $DefaultUnsetPageTextVars, or have I stumbled upon a
> bug?
More information about the pmwiki-users
mailing list