00999: Setting $EnableUploadVersions=1 causes errors
$EnableUploadVersions
=1 causes errorsDescription:
When setting the variable $EnableUploadVersions
=1, the following errors appear at the bottom of the generated wiki page:
Warning: preg_match_all() expects parameter 2 to be string, array given in C:\xampplite\htdocs\pmwiki.php on line 411
Warning: Invalid argument supplied for foreach() in C:\xampplite\htdocs\pmwiki.php on line 412
I am suspending this issue because recent versions of PmWiki appear not to have it (pmwiki.org uses $EnableUploadVersions
=1 and doesn't display the error). If something like this happens in the latest version, please add a new PITS entry for it. Thanks! --Petko December 18, 2011, at 02:08 PM
Recipes: BlogIt, AuthUser, AuthUserCookie, PmForm, ...
Description:
Independent of "EnableUploadVersions" status, I find in my Uniserver error log:
PHP Warning: Invalid argument supplied for foreach() in E:\\UniServer\\www\\wiki\\pmwiki.php on line 419, referer: "Some Wiki page"
line 418: function SDVA(&$var,$val)
line 419: { foreach($val as $k=>$v) if (!isset($var[$k])) $var[$k]=$v; }
I don't understand the function, sorry. What's going wrong? --Jazzvox December 18, 2011, at 01:07 PM
If it is independent of the "EnableUploadVersions" status, it may be better to open a new PITS entry for it.
This function sets default values if such values have not yet been set in config.php. It expects the first parameter to be the name of the array, and the second parameter to be an array of key=>value pairs. An error as yours probably means that the second parameter isn't set or is not an array. If I were you, I'd first check my config.php, then any recipes that are installed -- I can disable recipes one after another and test the wiki every time to see if the error disappears (when the error disappears, I'll know which recipe caused it). --Petko December 18, 2011, at 02:04 PM