01073: GroupPrintHeaderFmt and GroupPrintFooterFmt should initialise basepage

Summary: GroupPrintHeaderFmt and GroupPrintFooterFmt should initialise basepage
Created: 2009-02-21 09:12
Status: Closed (fixed for 2.2.2)
Category:
From: mzuther
Assigned:
Priority:
Version: 2.2.0
OS: Ubuntu 8.10 (intrepid), apache 2.2.9, php 5.2.6

Description: Hi!

The variables $GroupPrintHeaderFmt and $GroupPrintFooterFmt are not initialised correctly on print. To reproduce the error, simply create the pages Somegroup.GroupHeader and Somegroup.GroupPrintHeader and add the markup {$FullName} to each. Then open a page such as Somegroup.Somegroup, it will show the page's name on top. Now, click on print, and you'll see Somegroup.GroupPrintHeader instead.

I've located the problem in the file pub/skins/print/print.php:

   SDV($GroupPrintHeaderFmt,'(:include $Group.GroupPrintHeader:)(:nl:)');
   SDV($GroupPrintFooterFmt,'(:nl:)(:include $Group.GroupPrintFooter:)');

should be changed to something similar as $GroupHeaderFmt and $GroupFooterFmt. In order to keep you from updating pub/skins/print/print.php everytime you change these variables, I have thought of this:

   SDV($GroupPrintHeaderFmt,
       str_replace('.GroupHeader', '.GroupPrintHeader', $GroupHeaderFmt));
   SDV($GroupPrintFooterFmt,
       str_replace('.GroupFooter', '.GroupPrintFooter', $GroupFooterFmt));

It works fine on my installation of PmWiki. Thanks for fixing this, and have a nice week-end!!!

Martin

I believe this is not a bug. {$FullName} means the current physical page where the markup is. In Group.GroupHeader it will also display "Group.GroupHeader", in a SideBar it will be "Group.SideBar". If you want the variable to be relative to the currently browsed page, you need to use {*$FullName} with an asterisk. --Petko February 21, 2009, at 11:51 AM


Hi Petko,

thanks for replying so fast. You're right - I had forgotten about "starred" page variables...

Still, try my experiment and insert both {$FullName} and {*$FullName} in the pages Somegroup.GroupHeader and Somegroup.GroupPrintHeader. At least on my system, the "non-starred" version is different on printed pages. And I think the wiki should be consistent and not change its output upon printing (given the same markup), so this should be fixed somehow. But, taking your view into account, maybe the bug lies in $GroupHeaderFmt and $GroupFooterFmt?!? ;)

Martin

The problem was with $GroupPrint*Fmt, most likely forgotten when the basepage= parameter was implemented. Fixed for 2.2.2. Thanks! --Petko May 07, 2009, at 10:04 PM