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

dev/core#934 Fix regression on sorting activity tab by 'Added by' #14194

Merged
merged 1 commit into from
May 5, 2019

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented May 3, 2019

Overview

Fixes regression whereby source_name no longer sorts due to api not supporting it (yet)

Before

Screenshot 2019-05-03 13 32 15

After

works

Technical Details

Note that handling target_name or assignee_name introduces a tonne of complexity due the 1->N relationship - ug. In the UI sort_name & target_name are sortable

Comments

Actually the PR doesn't even fix it yet :-(

@civibot civibot bot added the master label May 3, 2019
@civibot
Copy link

civibot bot commented May 3, 2019

(Standard links)

if (in_array(['source_contact_name', 'source_contact_name desc', 'source_contact_name asc'], $options['return'])) {
$sql->join(
'source_contact',
'!joinType civicrm_activity_contact !alias ON (!alias.activity_id = a.id AND record_type_id = ' . CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source') . ')',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this isn't right yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

needs to be a subquery with min or max around display name I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope just checked & the UI only supports source contact - which is a one to one so simple join is fine

@eileenmcnaughton eileenmcnaughton changed the base branch from master to 5.14 May 4, 2019 03:14
@civibot civibot bot added 5.14 and removed master labels May 4, 2019
@eileenmcnaughton eileenmcnaughton force-pushed the activity_sort branch 2 times, most recently from 472e1e2 to beb8974 Compare May 4, 2019 03:16
@@ -592,7 +586,6 @@ public function testGetActivitiesforContactSummary() {
'activity_type_id' => NULL,
'offset' => 0,
'rowCount' => 0,
'sort' => NULL,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this by accident but I think it might not be a bad thing as it ensures enotices don't get thrown

@eileenmcnaughton eileenmcnaughton changed the title dev/core#934 [wip] Activity sort dev/core#934 Fix regression on sorting activity tab by 'Added by' May 4, 2019
@seamuslee001
Copy link
Contributor

seamuslee001 commented May 5, 2019

(CiviCRM Review Template WORD-1.2)

  • General standards
    • (r-explain) Pass
    • (r-user) Pass fixes a regression in sorting activities
    • (r-doc) Pass
    • (r-run) Pass confirmed that this fixes the issue with sorting by the added by field
  • Developer standards

@seamuslee001 seamuslee001 merged commit f636521 into civicrm:5.14 May 5, 2019
@seamuslee001 seamuslee001 deleted the activity_sort branch May 5, 2019 02:38
totten added a commit to totten/civicrm-core that referenced this pull request May 6, 2019
This updates a line which was added in the past day (civicrm#14194) to ensure that
the data is escaped.
totten added a commit to totten/civicrm-core that referenced this pull request May 6, 2019
This updates a line which was added in the past day (civicrm#14194) to ensure that
the data is escaped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants