[pmwiki-devel] patch for PTV issues

Peter Bowers pbowers at pobox.com
Fri Jun 26 13:02:43 CDT 2009


(I already sent this to Petko offlist, but since the thread today indicated
sending it to the dev list, I'll do that as well.)

2 issues have been identified recently which have to do with the fact that
PTVs are always read from the saved copy of a page.

(1) During preview the saved copy is used instead of the copy that you have
just edited
(2) During save if an invisible PTV is used to hold a link which is then
shown elsewhere, the link= in .pageindex is cached with the copy that was
previously on disk rather than the copy that is newly edited and being saved
now.

It's easier to read the attached patch than it is to explain what it does.
Basically it uses the newly-updated text of the page to update the in-memory
cache of PTVs rather than reading the page stored in the pagestore.

Review, testing, etc welcomed.  Particularly I'm interested if people think
the PTVCache() should check if $PCache[...]['=pagetextvars'] is set or allow
it to re-cache the PTV values if called explicitly...  (It's already checked
in PageTextVar().)

In any event, I'm hoping this (or something similar) will be considered for
addition into the core to resolve the 2 issues referred to above.

-Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20090626/936a8e9f/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: preview-fix.patch
Type: application/octet-stream
Size: 2375 bytes
Desc: not available
Url : http://www.pmichaud.com/pipermail/pmwiki-devel/attachments/20090626/936a8e9f/attachment.obj 


More information about the pmwiki-devel mailing list