From 8cab7b3d2cf6665d281b560841fe8d3ee35e4ab8 Mon Sep 17 00:00:00 2001 From: "agbud8@zabuntu" Date: Wed, 10 Feb 2021 18:39:37 -0500 Subject: [PATCH] core#1132 - don't fire hook_civicrm_fieldOptions before hook_civicrm_config loads all files --- CRM/Core/I18n.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Core/I18n.php b/CRM/Core/I18n.php index 0c560c872324..e4653d3be758 100644 --- a/CRM/Core/I18n.php +++ b/CRM/Core/I18n.php @@ -184,8 +184,11 @@ public static function languages($justEnabled = FALSE) { static $enabled = NULL; if (!$all) { - $all = CRM_Contact_BAO_Contact::buildOptions('preferred_language'); + // Use `getValues`, not `buildOptions` to bypass hook_civicrm_fieldOptions. See core#1132. + CRM_Core_OptionValue::getValues(['name' => 'languages'], $optionValues, 'weight', TRUE); + $all = array_column($optionValues, 'label', 'name'); + // FIXME: How is this not duplicative of the lines above? // get labels $rows = []; $labels = [];