[Rt-commit] r19525 - in rt/3.999/trunk: .
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu May 7 03:20:49 EDT 2009
Author: sunnavy
Date: Thu May 7 03:20:49 2009
New Revision: 19525
Modified:
rt/3.999/trunk/ (props changed)
rt/3.999/trunk/lib/RT/Model/Config.pm
Log:
r20821 at sunnavys-mb (orig r19268): sunnavy | 2009-04-17 13:40:38 +0800
empty string is treated as undef in Jifty's record, but we don't want this behavior in Model::Config, so hack for it
Modified: rt/3.999/trunk/lib/RT/Model/Config.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Config.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Config.pm Thu May 7 03:20:49 2009
@@ -75,7 +75,9 @@
my $config = RT::Model::Config->new;
my ( $ret, $msg ) = $config->load_by_cols( name => $name );
if ($ret) {
- return $config->value;
+ my $value = $config->value;
+ return '' if defined $value && $value eq '[empty string]';
+ return $value;
}
else {
return;
@@ -112,6 +114,10 @@
my $name = shift;
my $value = shift;
+ if ( defined $value && $value eq '' ) {
+ $value = '[empty string]'; # bloddy hack, or '' will be treated as undef
+ }
+
my $config = RT::Model::Config->new( current_user => RT->system_user );
my ( $ret, $msg ) = $config->load_by_cols( name => $name );
if ($ret) {
More information about the Rt-commit
mailing list