[pmwiki-users] markup expression: what name & where?

Hans design5 at softflow.co.uk
Mon Nov 12 14:36:33 CST 2007

Monday, November 12, 2007, 7:57:38 PM, Patrick R. Michaud wrote:

> FWIW, there may be a slight problem (race condition) with 
> trying to use a markup expression to generate unique pagenames 
> based on incrementing page numbers.  

> In particular, suppose two people load the page containing
> {(ticket)} on or about the same time.  In such a case both
> would receive the same identifier for "next page", and upon
> hitting 'post' or its equivalent they would end up saving
> to the same page.

Thanks for pointing this out. It is more likely with increasing users
using such system, less likely if there are just a few. In  any case
it is simple to set the form with Fox so a pagecheck is done. Which
means if the page exists one is returned to the form with an error
message, and the ticket markup expression is increased. Not all is
lost, but it may be inconvenient.

> Better might be to have some form of marker in the pagename itself
> (or in an alternate parameter) that says "determine a unique
> pagename at the time this page is being saved".  This is the
> approach that PmForms intends to take.

Yes, very good. Might it work by giving the markup expression another
"wrapper", so it is not evaluated when the page is created, but will
only be evaluated when the form post is processed, by the form
processor "unwrapping" it and calling MarkupExpression() directly with
the expression? I imagine this as part of the initial
variable substitutions.


More information about the pmwiki-users mailing list