[pmwiki-users] {$Action} broken?

Patrick R. Michaud pmichaud at pobox.com
Mon Aug 28 12:50:53 CDT 2006


On Mon, Aug 28, 2006 at 07:15:39PM +0200, Bart wrote:
> On Fri, Aug 25, 2006 at 03:50:00PM -0500, Patrick R. Michaud wrote:
> | However, a very good workaround for the moment is to explicitly
> | create an ?action=print handler:
> | 
> |     $HandleActions['print'] = $HandleActions['browse'];
> |     $HandleAuth['print'] = $HandleAuth['browse'];
> | 
> | Having an explict action entry for 'print' prevents PmWiki
> | from converting ?action=print into ?action=browse.
> 
> I just put this in my config.php and it works very well. Thanks Pm :-)
> Just out of curiosity. What is actually causing the unwanted behavior?

Currently, any action that doesn't have its own handler
silently converts the $action variable into 'browse', so that
HandleBrowse() is called.  There are probably other ways to
handle the case when an unknown action is specified, but this
has the nice advantage of making sure that $action becomes a
valid value of some sort, without doing anything too out of the
ordinary.

The issue with ?action=print was simply that PmWiki didn't
explicitly recognize 'print', and so it was converting $action
into 'browse'.  But since the two essentially do the same thing,
nobody really came across a difference until now.  :-)

At any rate, the answer I like so far is to explicitly recognize
?action=print as a valid action.  It will appear that way in the
next release.

Thanks!

Pm




More information about the pmwiki-users mailing list