[pmwiki-devel] UpdatePage() and warnings

Petko Yotov 5ko at free.fr
Sat Nov 4 05:14:22 CST 2006


On Saturday 04 November 2006 01:23, Petko Yotov wrote:
> 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.
>

I should add that in the RecentChanges page the modification is logged as:

* Main.WikiSandbox . . . $CurrentTime by Link: 

instead of (when I manually edit a page):
* Main.WikiSandbox . . . November 04, 2006, at 01:19 AM by Petko: 

that is, neither the time, not the author are shown. I fear this is a bug.

Petko Yotov




More information about the pmwiki-devel mailing list