[pmwiki-users] EnableDrafts and PmForm

Petko Yotov 5ko at 5ko.fr
Tue Dec 9 18:40:57 CST 2014

On 10.12.2014 00:53, Criss Ittermann wrote:
> Something is weird in my installation.
> My PmForm is very long. Since the body of the form is fine (it is
> pulling in the correct data from the -Draft page), I'll truncate it
> The only other thing I can think of is if there were any other files
> that changed other than scripts/drafts.php and scripts/forms.php --
> were there any changes to pmform.php?


> Anything else?

I normally debug an installation by removing all features/recipes/skins 
and/or complex parts of the PmForm; if it works, then some of the 
recipes/parts may cause the bug. Then I add all recipes one by one and 
test every time until I the bug is reproduced. At that moment I know 
that the latest feature enabled is likely causing the problem, so I 
investigate it.

Does the simpler PmForm which works for me works for you?

Otherwise I test the program flow and processing of the data by printing 
some variables in the PHP files so that I see what exactly is happening.

For example, you can use some debugging functions like those:


> I did not change
> out my whole installation with what is in svn, only the files that
> were mentioned.

I don't know which version(s) you use, but indeed there may be some 
differences. If I was unsure, I would download the pre-release and run a 
diff utility to see if there are other modified files.


>> On Dec 9, 2014, at 4:05 PM, Petko Yotov <5ko at 5ko.fr> wrote:
>> Could you please double check that after you press "Save draft" then
>> open the non-draft page, you have actually opened the *non-draft*
>> page? If you simply click on the "edit" link for the non-draft page,
>> and there is a draft page, PmWiki actually opens the draft page for
>> editing - this is normal and expected.
>> For me the "save draft" button updates only the draft page. Here are
>> my two pmform templates:
>> [[#dataform]]
>> (:input pmform target=savedata :)
>> (:input default source={*$FullName}-Draft,{*$FullName} :)
>> (:input default request=1 :)
>> (:messages:)
>> || Name:||(:input text $:name size=25 :) ||
>> || Email:||(:input text $:email size=25 :) ||
>> (:input submit post Save:)
>> (:if auth admin:)
>> (:input submit postdraft "Save draft":)
>> (:else:)
>> (:input hidden postdraft 1:)
>> (:if:)
>> (:input end:)
>> * '''{*$FullName}''': Name={{*$FullName}$:name},
>> E-mail={{*$FullName}$:email}
>> * '''{*$FullName}-Draft''': Name={{*$FullName}-Draft$:name},
>> E-mail={{*$FullName}-Draft$:email}
>> [[#dataformend]]
>> [[#datapost]]
>> (:template defaults savevars=$:name,$:email :)
>> [[#datapostend]]
>> Near the end of the #dataform snippet, I placed the variables from
>> both the draft page and the public page, just to see if it works. As
>> admin, when I press "Save draft", only the draft variables are
>> created or modified. When I press "Save", the draft page is deleted
>> and the public page variables are updated.
>> Note also that, if there is a draft page, with the line
>> (:input default source={*$FullName}-Draft,{*$FullName} :)
>> the form is pre-filled with the variables from the draft page, this
>> is also normal and expected.
>> Petko

More information about the pmwiki-users mailing list