-
-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert deprecated OptionGroup::getLabel to PseudoConstant::getLabel for cases #13460
Convert deprecated OptionGroup::getLabel to PseudoConstant::getLabel for cases #13460
Conversation
(Standard links)
|
5b721e8
to
6283dd6
Compare
@colemanw I think they both work but I agree your suggestions are more consistent with what would be expected. I'll re-test in the next couple of days. |
Ok @mattwire I'm adding WIP to the title until you're ready. |
6283dd6
to
cedb74c
Compare
@@ -726,7 +726,7 @@ public static function getCases($allCases = TRUE, $params = array(), $context = | |||
); | |||
} | |||
} | |||
if (self::checkPermission($actId, 'edit', $case['activity_type_id'], $userID)) { | |||
if (isset($case['activity_type_id']) && self::checkPermission($actId, 'edit', $case['activity_type_id'], $userID)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resolves a php notice
$this->_encounterMedium = CRM_Core_DAO::getFieldValue('CRM_Activity_DAO_Activity', $this->_activityId, 'medium_id'); | ||
if (!array_key_exists($this->_encounterMedium, $encounterMediums)) { | ||
$encounterMediums[$this->_encounterMedium] = CRM_Core_OptionGroup::getLabel('encounter_medium', $this->_encounterMedium, FALSE); | ||
if ($this->_activityId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And another php notice
$caseTypeIDs = explode(CRM_Core_DAO::VALUE_SEPARATOR, | ||
$dao->case_type_id | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$caseTypeID and $caseTypeIDs are never used...
@colemanw you were correct... all now updated and tested. |
I've just tested it as well. Works great. |
Overview
Convert a deprecated function for cases
Before
Uses the deprecated
CRM_Core_OptionGroup::getLabel
function which logs a deprecated warning.After
Use the replacement
CRM_Core_PseudoConstant::getLabel
function.Technical Details
Default context for getLabel is "get" which means we get translated labels and disabled values. So it matches previous behaviour.
Comments