In Cairo you could define variable that were lower, mixed or upper case.
In Dakar it only works with uppercase. It breaks a lot of topics where people have defined variables.
It turns out to be a pretty big problem for us. I do not know why the users took so long to report it to me. I got it from several during a training session.
We should get this back working like in Cairo.
Test case. The 4 variables below all expands in Cairo!
- Set variable = lowcase
- Set Variable = mixcase
- Set VariableName = wikiword
- Set VARIABLEVAR = uppercase
lowcase
wikiword
mixcase
uppercase
You have to copy the test case to a real topic because the variable setting does not work in a form.
KJL
ML pointed out on #twiki that the bug probably relates to line in 401 in TWiki.pm
# %TAG% name
$regex{tagNameRegex} = qr/[$regex{upperAlpha}][$regex{upperAlphaNum}_:]*/o;
Thanks Franz for adding the case to the report.
KJL
Thanks to
ML I could change the line of code so that TWiki4 accepts mixed case variables like Cairo does.
Here is the patch that does so. I will continue testing to see if it breaks something else.
Index: TWiki.pm
===================================================================
--- TWiki.pm (revision 9317)
+++ TWiki.pm (working copy)
@@ -398,7 +398,7 @@
$regex{mixedAlphaNumRegex} = qr/[$regex{mixedAlphaNum}]*/o;
# %TAG% name
- $regex{tagNameRegex} = qr/[$regex{upperAlpha}][$regex{upperAlphaNum}_:]*/o;
+ $regex{tagNameRegex} = qr/[$regex{mixedAlpha}][$regex{mixedAlphaNum}_:]*/o;
# Set statement in a topic
$regex{bulletRegex} = qr/^(?:\t| )+\*/;
KJL
My first fix on SVN. Blind chicken can also find a grain.
SVN TWiki4: 9323, SVN DEVELOP 9324
KJL
TWiki:Main.MartinCleaver spottet that I had missed that numbers are also allowed. So I should have changed the second upperAlphaNum to mixedAlphaNum.
This is corrected in SVN 9326 and SVN 9327
Thanks Martin
KJL
Several on #twiki did not know that you could have lower case letters and numbers and '_' in twiki variables. And for a good reason because it has never been documented.
I have added a short definition of the rules in
TWikiVariables
I have additionally added an automatic integration test case in the TestCases web on both DEVELOP and Twiki4 branches:
TestCaseAutoVariableNames
SVN 9371 and 9372
KJL
Closed with release of 4.0.2
KJL