NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use
trunk.foswiki.org to view this page for some minimal testing.
Use
Item9693 for docu changes for 1.2 and 2.0.
Item9203: Cannot use non-ascii characters in formfield formatting token
| Priority: |
CurrentState: |
AppliesTo: |
Component: |
WaitingFor: |
| Enhancement |
Closed |
Extension |
DBCachePlugin |
|
Generally wiki applications for Non-English speaking audiences will include form field names with non-ascii characters, such as "Título" ("Title" in Portuguese). These form fields are stored with a ascii-only field name ("Ttulo" in our example), and a title that corresponds to the original field name ("Título" in the example).
Both the
%FORMFIELD% macro and
%SEARCH%'s
$formfield(...) formatting token support that: if you look for "Título", they will actually lookup the field name "Ttulo".
But %DBQUERY%'s
$formfield(...) doesn't do that, and it would be nice if it behaved consistent with the existing similar funcionality.
The proposed solution is the following one:
diff --git a/DBCachePlugin/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm b/DBCachePlugin/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm
index 1a3533b..d3bb164 100644
--- a/DBCachePlugin/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm
+++ b/DBCachePlugin/lib/Foswiki/Plugins/DBCachePlugin/WebDB.pm
@@ -259,7 +259,7 @@ sub getFormField {
$form = $topicObj->fastget($form);
return '' unless $form;
- my $formfield = $form->fastget($theFormField) || '';
+ my $formfield = $form->fastget(Foswiki::Form::fieldTitle2FieldName($theFormField)) || '';
return urlDecode($formfield);
}
--
AntonioTerceiro - 25 Jun 2010
Makes sense. However instead of calling
fieldTitle2FieldName - which is a non-official api - I'd prefer to copy&paste the three regexes in there over to the code.
--
MichaelDaum - 25 Jun 2010
done at r9180
--
AntonioTerceiro - 16 Sep 2010