[pmwiki-devel] Strange keywords and description behavior...

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 5 09:53:15 CDT 2007


On Thu, Apr 05, 2007 at 10:22:21AM -0400, The Editor wrote:
> > - The quotes are missing around "text" in "$newpage[text]"
> 
> Why would I want quotes here?

    http://www.php.net/manual/en/language.types.array.php#language.types.array.foo-bar

> >But none of these would seem to explain the results you're seeing,
> >which is why I think the error has to be somewhere other than these
> >lines of code.
> 
> Ok, I reposted the whole functon below.  Again, as far as I can tell,
> the changes are made to the page code exactly as desired.  But when
> the page updates, PmWiki is not making the changes properly to the
> page attributes.  My guess is it is because ZAP is running this
> routine three times, once for each attribute, and perhaps some page
> cache or something is confusing PmWiki.

Yes, that's it.  PmWiki doesn't expect to have UpdatePage() be
called multiple times for a page -- as a result, it's
re-rendering the page each time the page is called, and
each rendering adds more keywords and descriptions to the result.

But even if that part worked, I'd still recommend against
calling UpdatePage() separately for each update, as each individual
attribute setting then shows up as a separate entry in the
page's history.  They really ought to be a single entry.

I should also note that I've indicated in previous posts that
PmWiki's internal handling of (:keywords ...:), (:title ...:),
and (:description ...:) are likely to change during beta, so I
wouldn't get too attached to PmWiki's current implementation.
However, for a kludgy workaround, you could try clearing
PmWiki's internal cache prior to each call of UpdatePage:

    unset $PCache[$pagename];

Pm



More information about the pmwiki-devel mailing list