Eileen has uploaded a new change for review.
https://gerrit.wikimedia.org/r/240303
Change subject: T99836 Civi46: remove calls to pesudoconstant:phoneType
......................................................................
T99836 Civi46: remove calls to pesudoconstant:phoneType
This function is gone from 4.6
Change-Id: Icaf9c3a2a6b16192deca57d53c24b913266f8059
---
M sites/all/modules/wmf_reports/wmf_reports.install
1 file changed, 16 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm
refs/changes/03/240303/1
diff --git a/sites/all/modules/wmf_reports/wmf_reports.install
b/sites/all/modules/wmf_reports/wmf_reports.install
index e971afc..9dd37e7 100644
--- a/sites/all/modules/wmf_reports/wmf_reports.install
+++ b/sites/all/modules/wmf_reports/wmf_reports.install
@@ -82,7 +82,7 @@
);
}
- $phone_types = array_keys(CRM_Core_PseudoConstant::phoneType());
+ $phone_types = array_keys(wmf_reports_get_options('Phone',
'phone_type_id'));
foreach ($phone_types as $phone_type)
{
$mapping_fields[] = array(
@@ -115,6 +115,20 @@
}
/**
+ * Get options for a field.
+ *
+ * @param string $entity
+ * @param string $field
+ *
+ * @return array
+ * @throws \CiviCRM_API3_Exception
+ */
+function wmf_reports_get_options($entity, $field) {
+ $options = civicrm_api3($entity, 'getoptions', array('field' => $field));
+ return $options['values'];
+}
+
+/**
* Remove some of the mapping fields thanks to a hard mysql limit of
* 61 join tables.
*/
@@ -136,7 +150,7 @@
'Pager',
'Voicemail',
);
- $all_phone_types = CRM_Core_PseudoConstant::phoneType();
+ $all_phone_types = wmf_reports_get_options('Phone', 'phone_type_id');
foreach ($drop_phone_types as $name)
{
$id = array_search($name, $all_phone_types);
--
To view, visit https://gerrit.wikimedia.org/r/240303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaf9c3a2a6b16192deca57d53c24b913266f8059
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: civi-4.6.9-deploy
Gerrit-Owner: Eileen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits