From d962cd76a8027c857e853373db1d5952d1816326 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 10 Oct 2015 16:50:19 +1300 Subject: [PATCH] CRM-17120 remove last instance of call to uncached CRM_Core_OptionGroup::optionLabel fn I searched & didn't find any other instances of this function --- CRM/Contact/Page/View/Note.php | 3 ++- CRM/Core/OptionGroup.php | 21 --------------------- xml/schema/Core/Note.xml | 3 +++ 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/CRM/Contact/Page/View/Note.php b/CRM/Contact/Page/View/Note.php index ffc3657c4b..b762d92666 100644 --- a/CRM/Contact/Page/View/Note.php +++ b/CRM/Contact/Page/View/Note.php @@ -58,8 +58,9 @@ class CRM_Contact_Page_View_Note extends CRM_Core_Page { $note->id = $this->_id; if ($note->find(TRUE)) { $values = array(); + CRM_Core_DAO::storeValues($note, $values); - $values['privacy'] = CRM_Core_OptionGroup::optionLabel('note_privacy', $values['privacy']); + $values['privacy'] = CRM_Core_PseudoConstant::getLabel('CRM_Core_BAO_Note', 'privacy', $values['privacy']); $this->assign('note', $values); } diff --git a/CRM/Core/OptionGroup.php b/CRM/Core/OptionGroup.php index 4ae7c85811..dcddadd583 100644 --- a/CRM/Core/OptionGroup.php +++ b/CRM/Core/OptionGroup.php @@ -561,27 +561,6 @@ DELETE g, v $dao = CRM_Core_DAO::executeQuery($query, $params); } - /** - * @param string $groupName - * @param $value - * - * @return null|string - */ - public static function optionLabel($groupName, $value) { - $query = " -SELECT v.label - FROM civicrm_option_group g, - civicrm_option_value v - WHERE g.id = v.option_group_id - AND g.name = %1 - AND v.value = %2"; - $params = array( - 1 => array($groupName, 'String'), - 2 => array($value, 'String'), - ); - return CRM_Core_DAO::singleValueQuery($query, $params); - } - /** * @param string $groupName * @param $fieldValue diff --git a/xml/schema/Core/Note.xml b/xml/schema/Core/Note.xml index c71cd3f8da..128da7796e 100644 --- a/xml/schema/Core/Note.xml +++ b/xml/schema/Core/Note.xml @@ -102,5 +102,8 @@ 255 Foreign Key to Note Privacy Level (which is an option value pair and hence an implicit FK) 3.3 + + note_privacy + -- 2.25.1