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

getCaseRoles not working when supplied relationship id. civicrm_relationship table name changed to alias name rel because its changed in the actual query #12245

Merged
merged 1 commit into from
Jun 1, 2018

Conversation

sritechie26
Copy link

@sritechie26 sritechie26 commented Jun 1, 2018

Overview

This function call getCaseRoles($contactID, $case_id, $relationshipID); from Case.php file in \civicrm\CRM\Case\BAO location

CRM_Case_BAO_Case::getCaseRoles($contactID, $case_id, $relationshipID);

throwing error when passing $relationshipID. because actual query changed with alias name but one where condition is not changed with alias name. So updated with alias name to fix this issue.

Before

if ($relationshipID) {
$query .= ' AND civicrm_relationship.id = %3 ';
$params[3] = array($relationshipID, 'Integer');
}

After

if ($relationshipID) {
$query .= ' AND rel.id = %3 ';//Changed this alias name "rel" here
$params[3] = array($relationshipID, 'Integer');
}

…s changed in the actual query but not in this extra Where condition
@civicrm-builder
Copy link

Can one of the admins verify this patch?

@sritechie26 sritechie26 changed the title civicrm_relationship table name changed to alias name rel, because its changed in the actual query but not in this extra Where condition getCaseRoles not working when supplied relationship id. civicrm_relationship table name changed to alias name rel because its changed in the actual query Jun 1, 2018
@colemanw
Copy link
Member

colemanw commented Jun 1, 2018

@civicrm-builder add to whitelist

@colemanw
Copy link
Member

colemanw commented Jun 1, 2018

Looks sensible and safe to me.

@seamuslee001
Copy link
Contributor

Merging as per tag

@seamuslee001 seamuslee001 merged commit 46e82c1 into civicrm:master Jun 1, 2018
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.

4 participants