[Pmwiki-users] pmwiki 2.0 pre-populated page question

Patrick R. Michaud pmichaud
Wed Dec 29 13:59:29 CST 2004


On Wed, Dec 29, 2004 at 02:48:10PM -0500, Bryant Durrell wrote:
> I just migrated to 2.0; very smooth migration and I'm thankful for all
> the work that's been done to make the upgrade easy.  I do have one problem
> I can't figure out.  [...]
> 
> <?php
> $SessionTemplatePage = '$Group.SessionTemplate';
> if ($action=="edit") {
>   if (strpos($pagename, "Session")) {
>     $formpage = ReadPage(FmtPageName($SessionTemplatePage,$pagename));
>     $DefaultPageTextFmt = $formpage['text'];
>   }
> }
> ?>

Perhaps a bug here, but in 2.0 the edit form doesn't populate the
page text with $DefaultPageTextFmt anymore.  There was some reason I
decided not to do this (probably having to do with dealing with Fmt
strings in the text template).  Try the following instead:

if ($action=='edit' && !@$_POST['text']) {
  if (strpos($pagename,'Session')!==false) {
    $formpage = ReadPage(FmtPageName('$Group.SessionTemplate',$pagename));
    $DefaultPageTextFmt = $formpage['text'];
    $_POST['text'] = $formpage['text'];
  }
}
  
If that doesn't work, I'll find a way to make it work.

Pm



More information about the pmwiki-users mailing list