[pmwiki-users] PagelistTemplate format invoked from search action

Patrick R. Michaud pmichaud at pobox.com
Sat Jun 3 11:43:32 CDT 2006


On Sat, Jun 03, 2006 at 11:21:59AM -0400, Pico wrote:
> I'm playing around with PageListTemplates that iterate over the 
> $LastModifiedBy variable.  They work fine when invoked from a pagelist 
> directive, but time out when I try to invoke it from a link with a 
> search action.  See Test/PagesLastModifiedByYou.
> 
> Question 1
> In terms of processing, is a pagelist directive more efficient than a 
> search action, or is there some difference between the way these are 
> processed that could account for the time outs that I am experiencing 
> with a search action, but not with a page list?

Ah, I figured it out.  There's not a difference between search and
pagelist -- the url for the action=search version has a subtle flaw 
in it:

> Here is the background:
> 1. The PageListTemplate is contained in the same page that is calling 
> the directive
> 2. The pagelist directive is stated as follows: (:pagelist 
> fmt={$Name}#lastmodbyme:)
> 3. The search action is stated as:  
> [[{$Name}?action=search&q=fmt={$Name}#lastmodbyauthor]]
> 4. The resulting url appears as: 
> http://[Path/To/Page]?action=search&q=fmt=[Page]#lastmodbyauthor

Note that the url ends in #lastmodbyauthor, the browser sees this
as a page fragment identifier and so it's not sent to PmWiki.
Thus, what PmWiki receives in the url request is just

    http://[Path/To/Page]?action=search&q=fmt=[Page]

which says to use the entire [Page] as the pagelist template.
Since that page happens to contain a nested (:pagelist:) directive
in it, the script will run until it either runs out of memory or
otherwise times out.

The correct url would be

    http://[Path/To/Page]?action=search&q=fmt=[Page]%23lastmodbyauthor

Pm




More information about the pmwiki-users mailing list