Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Wed, Jul 23, 12:52 PM

in-portal

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