[pmwiki-users] powertools newticket issue with -Talk pages.

Hans design5 at softflow.co.uk
Tue Mar 16 02:40:31 CDT 2010


Monday, March 15, 2010, 10:33:17 PM, Mark Bacas wrote:

> I think the simple fact that a talk page exists is throwing off the  
> newticket function in powertools as it appears to take the latest name
> and count 11 back. I was going to look at the code a little more  
> tonight even though I'm not a PHP developer.

> Seems like it would have to take the Group name into account and count
> +11 from there.

You have not explained how a new ticket page and/or a new ticket-Talk
page should be created. I don't understand why the existence of a
20100315001-Talk page for instance should influence the next ticket page.
You would have a page 20100315001 as well, yes?
The next ticket should be 20100315002 for the same day.
In the MakeNewTicket function in powertools.php the pages
containing 11 digits at the start of the page name get listed, the
maximum taken, then 1 added for a same day ticket number, or the day
number increased.
Try change this line in the function:

foreach(ListPages("/^$grp.\\d{11}/") as $p)

to this:

foreach(ListPages("/^$grp.\\d{11}$/") as $p)

adding the $ to the regex expression.
It should exclude any -Talk pages influencing the new ticket number.
Let me know if it works, so I can update the powertools.php recipe
accordingly.

thanks,
  ~Hans




More information about the pmwiki-users mailing list