[pmwiki-devel] UpdatePage() and warnings

Patrick R. Michaud pmichaud at pobox.com
Tue Nov 7 08:16:08 CST 2006


On Sat, Nov 04, 2006 at 01:23:59AM +0100, Petko Yotov wrote:
> 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');

When is this function being called?  It looks to me as
though it's being called prior to any of the markup rules
being loaded (and UpdatePage() really wants to occur
after the markup rules are loaded).

Pm



More information about the pmwiki-devel mailing list