[pmwiki-users] Conditional processing of FoxForms

Martin Kerz mkerz at me.com
Fri Jul 3 09:28:53 CDT 2009


Dear Hans,

thanks for your prompt reply.

> I would need some kind of preprocessing. I tried a FoxFilter in
>> config.php, that reads the following:
>
>> $FoxFilterFunctions['FoxFixUpload'] = 'FoxFixUploadFilter';
>
>>   function FoxFixUploadFilter($pagename, $fields) {
>>     if ($fields['upfile_name']="")
>>        {
>>        $fields['upfile_name']="placeholder.png";
>>        };
>>     return $fields;
>>   }
>
>> But this unfortunately didn't work. Can anyone help me here?
>
> I would have thought that such a filter function should work, if it
> is called in the Fox form. It should be defined before including
> fox.php in config.php.

Okay, I defined it after fox.php was called. Nevertheless, defining it  
above doesn't change the result.

> Have you checked that the filter function is used?
> You could set for testing purposes in fox.php
> $FoxDebug = 5;
> Make sure you do not use 'redirect' in the form when testing!
> You will get the $fields values echoed.
> See what happens to your file name.

Okay, obviously FoxFixUploadFilter() isn't called.
I get
$fx Array
(
...
[filter] => FoxFixUpload
...
)

But under "ENGINE> TEMPLATE-VR>" I get:

VALUE>upfile_name=

I've then rewritten FoxFixUploadFilter() to:

$FoxFilterFunctions['FoxFixUpload'] = 'FoxFixUploadFilter';

   function FoxFixUploadFilter($pagename, $fields) {
        $fields['upfile_name']="placeholder.png";
     return $fields;
   }

… but get the same error.

What could be wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20090703/6f665a84/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2428 bytes
Desc: not available
Url : http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20090703/6f665a84/attachment.bin 


More information about the pmwiki-users mailing list