jquery validation regexp in numeric tracker field fails after upgrade from 12.x to 14.x
Reproduced here in a 14.x site:
http://xavi-9794-5706.show.tikiwiki.org/tiki-index.php?page=HomePage
u: admin
p: 12345
Attempt to insert an item, selecting some positive number (e.g. "10") at "My positive number": you get the error message shown "Number must be positive"
That regexp expression works as expected in Tiki 12.x:
^[0]{1}$|^(?!0*[.,]0*$|[.,]0*$|0*$)\\d+[,.]?\\d{0,2}$
See it working in this equivalent 12.x instance:
http://xavi-9794-5707.show.tikiwiki.org/tiki-index.php?page=HomePage
u: admin
p: 12345
I'm afraid the escaping of the regexp patterns changed at some point between 12.0 and 14.x (i thought in 12.3 or 12.4).
Now you must not double up the backslashes as you have in your pattern, so this one works ok in 14.x like this:
^[0]{1}$|^(?!0*[.,]0*$|[.,]0*$|0*$)\d+[,.]?\d{0,2}$
I don't think it would be safe to try and do this with an upgrade script.
Thanks for fixing Jonny. And I agree this is not save to be in an upgrade script. However, this should be stated, though, in the upgrade instructions at doc.t.o at least, and at doc.t.o/Tiki14 page. I will drop some note there about it, and update the doc pafge about regexps also (doc.t.o/regexps)
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |