[pmwiki-users] PmWiki 2.2-beta12 - UpdatePage() released

Patrick R. Michaud pmichaud at pobox.com
Wed Oct 4 14:50:38 CDT 2006


On Wed, Oct 04, 2006 at 12:47:22PM -0400, The Editor wrote:
> Uh, help? I just downloaded the latest beta (12) and tried rewriting
> my setpage function which is the only place doing file saves.  And I'm
> getting this message:
> 
> PmWiki can't process your request
> Cannot write page to (wiki.d/)...changes not saved
> We are sorry for any inconvenience.
>
> Here's the function written mostly with cut and pastes from Crisses
> input.  Any thoughts anyone?
> 
> function SetPage() {
> 	global $WorkDir, $data, $log, $_POST, $DataKey;
> 	$d = $DataKey.$_POST[datapage];
> 	$oldpage = ReadPage($d);
> 	$newpage = $oldpage;
> 	$newpage['text'] = "(:comment data:) \n\n$data(:comment data:)
> \n\n[[#Log]] \n\n$log(:comment data:) \n\n";
> 	UpdatePage($pagename, $oldpage, $newpage);
> 	return;
> 	}

The UpdatePage line should probably read

    UpdatePage($d, $oldpage, $newpage);

This is probably the error you're getting; since $pagename is
not defined it means you're trying to write a page with an
empty pagename (i.e., "wiki.d/").

> Any help that anyone could give would be appreciated.  BTW, will this
> work if a page is not yet created also? 

If a page doesn't exist, UpdatePage() creates it if it can.

Pm




More information about the pmwiki-users mailing list