Skip to content
Snippets Groups Projects
Commit 01e21c0a authored by pratik.joshi's avatar pratik.joshi
Browse files

CRM-13591 : fixed condition check for display value returning function for...

CRM-13591 : fixed condition check for display value returning function for custom fields (i.e used for returning appropriate val for Yes/No fields)

----------------------------------------
* CRM-13591: Yes / No fields are not properly displayed in profile view
  http://issues.civicrm.org/jira/browse/CRM-13591
parent 2b730076
No related branches found
No related tags found
No related merge requests found
...@@ -1180,7 +1180,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { ...@@ -1180,7 +1180,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
if ($value) { if ($value) {
$display = ts('Yes'); $display = ts('Yes');
} }
elseif ($value === '0') { elseif ((string)$value === '0') {
$display = ts('No'); $display = ts('No');
} }
} }
...@@ -1345,7 +1345,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { ...@@ -1345,7 +1345,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
$display = $value; $display = $value;
} }
} }
return $display ? $display : $value; return $display ? $display : $value;
} }
......
...@@ -1538,7 +1538,10 @@ WHERE id = $cfID ...@@ -1538,7 +1538,10 @@ WHERE id = $cfID
if ($dao->data_type == 'Int' || if ($dao->data_type == 'Int' ||
$dao->data_type == 'Boolean' $dao->data_type == 'Boolean'
) { ) {
$customVal = (int )($params[$name]); $v = $params[$name];
if (!CRM_Utils_System::isNull($v)) {
$customVal = (int)$v;
}
} }
elseif ($dao->data_type == 'Float') { elseif ($dao->data_type == 'Float') {
$customVal = (float )($params[$name]); $customVal = (float )($params[$name]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment