RecentChanges behavior (was:Re: [pmwiki-users] PmWikiDe group on pmwiki.org)

Patrick R. Michaud pmichaud at pobox.com
Tue Sep 6 16:37:21 CDT 2005


On Tue, Sep 06, 2005 at 05:06:08PM -0400, Neil Herber wrote:
> Am I mistaken, or does RecentChanges *not* behave like a journal or log?
> 
> I always expect to see *every* change made to a page in 
> RecentChanges, and I often find that changes I have made have been 
> superceded by someone else editing the page.

By default, RecentChanges does not behave like a journal or a log.
It's intended to show which pages on the site have recently been
changed (for a quick review of site changes), not to show every
change that may have been made.  For example, on pmwiki.org,
I typically go to the Site.AllRecentChanges page and then open
(into Firefox tabs) each page that has changed since the last time
I reviewed the site, and then review each of those pages one-at-a-time.
If a page has been edited fifteen times, I don't want to be
opening up fifteen copies of the same page (or mentally keeping
track of which pages I've already opened).

> This would be fine behavior if the second change was exactly 
> reversing my change (using Restore, for example), but if two or more 
> people are editing the same page, I want to see the trail of edits 
> without having to go to the page history.

Fortunately, PmWiki gives you this option!  Set

    $RecentChangesFmt = array(
      '$SiteGroup.AllRecentChanges' =>
        '* [[$Group.$Name]] . . . $CurrentTime $[by] $AuthorLink:  [=$ChangeSummary=]',
      '$Group.RecentChanges' =>
        '* [[$Group/$Name]] . . . $CurrentTime $[by] $AuthorLink:  [=$ChangeSummary=]');

The key is in the two-consecutive-spaces after "$AuthorLink:". 
For better or worse, The PostRecentChanges() code uses those two 
consecutive spaces as the cutoff point when deciding if two entries
are to be treated as the same.  Normally the two spaces occur 
immediately after the page name link, which means that each page 
appears only once in the RecentChanges output.  

Originally, PmWiki v1 used the ". . ." dots as the cutoff point, 
but I switched to the two-consecutive spaces to support exactly 
the scenario you're wanting.  By moving the two spaces to after 
the author link, every edit will be seen as a unique entry in 
RecentChanges, because either the time or author changes.  As a 
result, RecentChanges will act more like a log of edits instead
of a summary.

Obscure?  A hack?  Yes.  But it was much easier to do this than 
to set up a bunch of special strings and/or flags to try to tell 
RecentChanges what to do.  (And, following PmWikiPhilosophy #3, 
we can always add more sophisticated RecentChanges code someday 
in the future when we need it.)

So, how's that?  ;-)

Pm




More information about the pmwiki-users mailing list