[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.4-110-gd8024dc
Thomas Sibley
trs at bestpractical.com
Thu Dec 1 16:29:57 EST 2011
The branch, 4.0-trunk has been updated
via d8024dc69f0470a3b9d3dc6aa4d18f2c5318811d (commit)
via b8a4a896b4edfa83fb1a5e218172e9f7927e5b48 (commit)
from 0d3ad45c2611344e2ade8927f88703b08646cb4f (commit)
Summary of changes:
share/html/Widgets/Form/Integer | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit b8a4a896b4edfa83fb1a5e218172e9f7927e5b48
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Wed Nov 30 20:06:59 2011 +0400
make sure 0 not replaced with '' in Integer form widget
diff --git a/share/html/Widgets/Form/Integer b/share/html/Widgets/Form/Integer
index b15a4c7..d4d1b7d 100644
--- a/share/html/Widgets/Form/Integer
+++ b/share/html/Widgets/Form/Integer
@@ -57,6 +57,8 @@ see docs/extending/using_forms_widgets.pod
<span class="hints"><% $Hints %></span>
</div>
<%INIT>
+$_ = '' foreach grep !defined, $CurrentValue, $DefaultValue;
+$DefaultLabel ||= loc( 'Default: [_1]', $DefaultValue );
</%INIT>
<%ARGS>
$Name
@@ -68,15 +70,18 @@ $CurrentValue => '',
$Default => 0,
$DefaultValue => 0,
-$DefaultLabel => loc( 'Default: [_1]', $DefaultValue || '' ),
+$DefaultLabel => undef
</%ARGS>
<%METHOD InputOnly>
-<input type="text" name="<% $Name %>" value="<% $CurrentValue || '' %>" />\
+<input type="text" name="<% $Name %>" value="<% $CurrentValue %>" />\
<%ARGS>
$Name
$CurrentValue => '',
</%ARGS>
+<%INIT>
+$CurrentValue = '' unless defined $CurrentValue;
+</%INIT>
</%METHOD>
<%METHOD Process>
commit d8024dc69f0470a3b9d3dc6aa4d18f2c5318811d
Merge: 0d3ad45 b8a4a89
Author: Thomas Sibley <trs at bestpractical.com>
Date: Thu Dec 1 16:23:22 2011 -0500
Merge branch '4.0/zero-in-integer-form-widget' into 4.0-trunk
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list