jenkins-bot has submitted this change and it was merged.

Change subject: Allow falsy values as custom field db defaults
......................................................................


Allow falsy values as custom field db defaults

Use isset(val) instead of just if(val) so we can set a custom field
database column's default to zero.

Change-Id: I4abdc4e608abf57b1443916f620b413791fc3d02
---
M CRM/Core/BAO/CustomField.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Awight: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php
index 3f2caf4..f734d65 100644
--- a/CRM/Core/BAO/CustomField.php
+++ b/CRM/Core/BAO/CustomField.php
@@ -1809,7 +1809,7 @@
       $params['fk_field_name'] = 'id';
       $params['fk_attributes'] = 'ON DELETE SET NULL';
     }
-    if ($field->default_value) {
+    if (isset($field->default_value)) {
       $params['default'] = "'{$field->default_value}'";
     }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/176003
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4abdc4e608abf57b1443916f620b413791fc3d02
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Awight <awi...@wikimedia.org>
Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org>
Gerrit-Reviewer: Katie Horn <kh...@wikimedia.org>
Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to