[pmwiki-devel] UpdatePage() and warnings

Petko Yotov 5ko at free.fr
Fri Nov 3 18:23:59 CST 2006


Hello,

I am using pmwiki-2.2.0-beta15 an I am trying to copy a page content into 
another page. I always get these errors:


Warning: array_keys() [function.array-keys]: The first argument should be an 
array in .../pmwiki.php on line 1458

Warning: array_values() [function.array-values]: The argument should be an 
array in .../pmwiki.php on line 1459

Warning: preg_replace() [function.preg-replace]: Empty regular expression 
in .../pmwiki.php on line 1459



Here is my function (adapted from 
http://www.pmwiki.org/wiki/Cookbook/DebuggingForCookbookAuthors ):

function CopyPageText($sourcename, $targetname)
{
    $source = RetrieveAuthPage($sourcename,"edit");
    if (!$source) { return; }

    $dest = RetrieveAuthPage($targetname,"edit");
    if (!$dest) { return; }

   $newdest = $dest;
   $newdest['text'] .= "\n".$source['text'];

   UpdatePage($targetname, $dest, $newdest);
}
CopyPageText( 'Main.HomePage', 'Main.WikiSandbox');



And then the whole page (sidebar, main content) is broken, shown as a 
wiki-code.

Actually, the text is copied, and the RecentChanges are logged, but there is 
this error and the wiki-to-html is not processed.

Any tips will be appreciated.

Greetings,
Petko Yotov



More information about the pmwiki-devel mailing list