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

Fix recent item deduping & call hooks #12704

Merged
merged 2 commits into from
Aug 27, 2018
Merged

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Aug 21, 2018

Overview

Fixes a bug when adding to the "recent items" list, where the same item would sometimes be added twice.
Also adds a fix to call hooks when deleting items, for consistency with add.

To reproduce

  1. Go to the contact menu and click on "new activity".
  2. Save the new activity. Note that it is now in the recent items list.
  3. Click on the activity in the recent items list.
  4. Note that it is now in the list twice.

Technical details

Strict type checking using === was overkill, as CiviCRM uses string and int values interchangeably. E.g. activity id 123 was being compared to the string "123".

@civibot
Copy link

civibot bot commented Aug 21, 2018

(Standard links)

@colemanw colemanw changed the title Fix recent item deduping Fix recent item deduping & call hooks Aug 21, 2018
@colemanw
Copy link
Member Author

@lcdservices when you have a sec could you run through the steps to reproduce above & comment? This affects the recent items menu (as well as the existing recent items block).

@lcdservices
Copy link
Contributor

Confirmed -- prior to the patch, a duplicate recent item was listed after creating and then viewing the activity. After the patch there is no duplicate.

@colemanw colemanw merged commit 8ef5ab5 into civicrm:master Aug 27, 2018
@colemanw colemanw deleted the recent branch August 27, 2018 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants