Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1072092
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 23, 12:52 PM
Size
1 KB
Mime Type
text/x-diff
Expires
Fri, Jul 25, 12:52 PM (14 h, 18 m)
Engine
blob
Format
Raw Data
Handle
694722
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/RC/core/kernel/utility/formatters/options_formatter.php
===================================================================
--- branches/RC/core/kernel/utility/formatters/options_formatter.php (revision 9342)
+++ branches/RC/core/kernel/utility/formatters/options_formatter.php (revision 9343)
@@ -1,48 +1,48 @@
<?php
class kOptionsFormatter extends kFormatter {
function Format($value, $field_name, &$object, $format=null)
{
if ( is_null($value) ) return '';
$options = $object->GetFieldOptions($field_name);
$label = getArrayValue($options['options'], $value);
if ($label !== false) {
// option_id found in options array
if (getArrayValue($options, 'use_phrases')) {
return $this->Application->Phrase($label);
}
else {
return $label;
}
}
else {
// option_id not found
- return $value == 0 ? '' : $value;
+ return "$value" == "0" ? '' : $value;
}
}
function Parse($value, $field_name, &$object)
{
if ($value == '') return NULL;
$options = $object->GetFieldOptions($field_name);
$use_phrases = getArrayValue($options, 'use_phrases');
$found = false;
foreach ($options['options'] as $option_key => $option_value) {
if ($use_phrases) {
$option_value = $this->Application->Phrase($option_value);
}
if ($option_value == $value) {
$found = true;
break;
}
}
return $found ? $option_key : $value;
}
}
\ No newline at end of file
Property changes on: branches/RC/core/kernel/utility/formatters/options_formatter.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.32.1
\ No newline at end of property
+1.1.32.2
\ No newline at end of property
Event Timeline
Log In to Comment