Skip to content
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

CRM-20947, fixed notice error on Activity tab #10788

Merged
merged 2 commits into from
Jul 31, 2017

Conversation

pradpnayak
Copy link
Contributor

@pradpnayak pradpnayak commented Jul 31, 2017

Overview

This PR fixes notice error when trying to save activity and viewing list of activity in Activity tab.

Before

noticeerror

After

No error.

Technical Details

This PR fixes the notice error of using deprecated function. I have replaced it with CRM_Core_PseudoConstant::getKey() method to retrieve value of option values.


----------------------------------------
* CRM-20947: Remove Deprecation Notice for Option group
  https://issues.civicrm.org/jira/browse/CRM-20947
@@ -2373,7 +2373,10 @@ public static function createFollowupActivity($activityId, $params) {
$followupParams = array();
$followupParams['parent_id'] = $activityId;
$followupParams['source_contact_id'] = CRM_Core_Session::getLoggedInContactID();
$followupParams['status_id'] = CRM_Core_OptionGroup::getValue('activity_status', 'Scheduled', 'name');
$followupParams['status_id'] = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity',
'activity_status',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be status_id

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops sorry.. Not sure how i missed that. Pushed the change.

@eileenmcnaughton
Copy link
Contributor

first one looks wrong, others look right

----------------------------------------
* CRM-20947: Remove Deprecation Notice for Option group
  https://issues.civicrm.org/jira/browse/CRM-20947

fixed fieldname
@eileenmcnaughton
Copy link
Contributor

I thought that last one was wrong & it should be just status_id - however grepping says

CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_status_id', 'Completed'),

These are simple changes but easy to make errors in - hopefully there won't be anything we both miss though!

@pradpnayak
Copy link
Contributor Author

yes both works (status_id / activity_status_id). I feel the code takes as field name or fields unique name defined in
https://github.com/civicrm/civicrm-core/blob/master/xml/schema/Activity/Activity.xml#L241

@eileenmcnaughton
Copy link
Contributor

Ah cool!

@eileenmcnaughton eileenmcnaughton merged commit 051396d into civicrm:master Jul 31, 2017
@pradpnayak pradpnayak deleted the CRM-20947 branch July 31, 2017 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants