[pmwiki-users] UpdatePage processing markup again

Peter & Melodye Bowers pbowers at pobox.com
Thu Apr 3 03:21:59 CDT 2008


> > My problem is in my specific situation I could very easily 
> end up with a
> > race condition where PageA contains an MX that writes to 
> PageB and PageB
> > contains an MX that writes to PageA.
> 
> I think you mean a "recursive condition" as opposed to a "race
> condition"?  PmWiki normally avoids race conditions by calling 
> Lock(2) prior to any transaction that involves updating
> a page or file.

So now we not only have to find words that sounds intelligent but we're also
supposed to find words that mean the right thing?!?  I think we're raising
the bar too high here... ;-)

You're exactly right - it's not a locking issue at all but rather unintended
recursion without an exit plan...  

> SaveAttributes is responsible for setting a variety of attributes
> within pages.  In particular, it's the thing that creates the
> targets, title, description, and keywords attributes in a page.
> We compute these attributes at the time the page is saved so that
> we don't have to try to figure them out whenever the page is
> read later.

I think after looking at it some more I've figured out what was confusing to
me.  Nothing is being done with the $html variable after it is set because
you aren't interested in the *results* of MarkupToHTML() -- you are
interested in the side effects of that process in getting the page cache
updated.  Is that correct?

> $EnablePost says whether or not posts are allowed, not whether
> one is occurring.
> ...
>     global $action;
>     if ($action != 'browse') return;

PERFECT!  Exactly what I was looking for.  It's now in code and will be part
of the next release...

Do I need to be concerned that if a WikiSh MX was being used, for instance,
to create a link to another page (or to create some other attribute that
SaveAttributes() was computing), that then the targets (or other attribute)
would not be correct and there could be problems in future searches?  I'm
thinking of something like this:

	{(wikish if test -z "{$MyPTV}"; then; echo "[[MyPage]]"; fi)}

Thanks!

-Peter




More information about the pmwiki-users mailing list