Page MenuHomeIn-Portal Phabricator

D46.diff
No OneTemporary

File Metadata

Created
Mon, Jan 6, 3:12 AM

D46.diff

Index: branches/5.2.x/core/kernel/utility/formatters/formatter.php
===================================================================
--- branches/5.2.x/core/kernel/utility/formatters/formatter.php
+++ branches/5.2.x/core/kernel/utility/formatters/formatter.php
@@ -209,11 +209,12 @@
*/
public function Parse($value, $field_name, &$object)
{
+ $options = $object->GetFieldOptions($field_name);
+
if ($value == '') {
- return NULL;
+ return $options['type'] == 'string' ? $value : null;
}
- $options = $object->GetFieldOptions($field_name);
$tc_value = $this->TypeCast($value, $options);
if ($tc_value === false) {

Event Timeline