[pmwiki-users] clue me in -- remove group name from pagelist?

Patrick R. Michaud pmichaud at pobox.com
Thu May 25 16:08:27 CDT 2006


On Thu, May 25, 2006 at 01:50:35PM -0700, Jo Rhett wrote:
> > On Thu, May 25, 2006 at 12:13:02PM -0700, Jo Rhett wrote:
> > > That makes sense to me.  Especially if the config.php syntax was to add the
> > > item to the array, rather than redefine the array.
> > > 
> > > array_unshift( $FPLTemplatePageFmt, '{$Group}.PagelistTemplates' );
> > > 
> > > This syntax is less likely to break an upgrade that changed the defaults
> > > for this array, right?
>  
> On Thu, May 25, 2006 at 03:27:29PM -0500, Patrick R. Michaud wrote:
> > Nope.  PmWiki sets a value for $FPLTemplatePagefmt only if the
> > admin hasn't already set one.  For some variables (this is one),
> > PmWiki figures that if the admin takes over the then it shouldn't
> > be second-guessing the admin's intent.
>  
> Ugh.  Then you have an upgrade problem waiting to happen.  If you define a
> value and then the default changes in a later upgrade, the person who has
> changed this may face a problem of unexpected behavior.  This is exactly
> the kind of thing I prefer to avoid.

On the whole, PmWiki manages to avoid upgrade problems such as this
quite well, actually.  At the very least this is historically the case.

There cannot be a hard-and-fast rule that applies for every configuration
variable in every situation.  The counter-example to the one you give
here is when someone performs an upgrade and suddenly their system
no longer works as it did before because PmWiki has changed a default
value.  There are places where we should bias things towards the
distribution defaults, and other places where we bias towards
the administrator's settings (always, of course, giving the 
administrator *some* mechanism to override whatever course 
PmWiki chooses).

You claim that this is an upgrade problem waiting to happen.  I disagree.
Let's suppose that Alice, our wiki administrator, overrides PmWiki's
default setting with the following:

    $FPLPageTemplateFmt = array( 'Site.LocalTemplates', 
      '{$SiteGroup}.PagelistTemplates');

Now then, we conjecture that some future version of PmWiki changes
the distribution default of $FPLPageTemplateFmt to be something
else -- let's say the new version uses '{$SiteGroup}.NewImprovedTemplates'
instead of '{$SiteGroup}.PagelistTemplates'.

What happens to Alice's site when she upgrades?  Well, she's overriding
the default setting of $FPLPageTemplateFmt, so PmWiki will continue to
use the Site.LocalTemplates and {$SiteGroup}.PagelistTemplates pages
Alice had set up before -- i.e., the system works exactly as it did 
before the upgrade.  This is generally what an administrator wants --
they expect that after performing an upgrade, any customizations they
have made will continue to work (as they worked before the upgrade).

Pm




More information about the pmwiki-users mailing list