-
-
Notifications
You must be signed in to change notification settings - Fork 825
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 for CRM-21122: "Support selection of smart groups on Contact Dashboard" #10925
Fix for CRM-21122: "Support selection of smart groups on Contact Dashboard" #10925
Conversation
There is a fatal error in the test PHP Fatal error: Call to undefined function array_column() in /home/jenkins/buildkit/build/core-10925-6mvfq/sites/all/modules/civicrm/tests/phpunit/CRM/Contact/Page/View/UserDashboard/GroupContactTest.php on line 120 Other than that @seamuslee001 do you want to put this through it's paces on performance? |
Curse you, php 5.3. You haven't heard the last of me! |
8b2870f
to
0763645
Compare
No more array_column(). Test are passing. Take that, php 5.3! |
You show em, @twomice! Show PHP 5.3 how real programmers vectorize the column of a multi-dimensional array! |
Aside: There's also CRM_Utils_Array::collect(). |
b395bb0
to
caecb7d
Compare
Jenkins test this please. |
Thanks for the tip, @totten -- I'll buy that for a dollar. I should have guessed CRM_Utils_Array would have something. |
Php is beaten into submission. This generally looks good but I would very much like @seamuslee001 to test it with their data as I'd like to be sure there is not a performance issue with groups. @systopia or @jaapjansma might have data sets worth testing on - or @davejenx |
caecb7d
to
ec6d2df
Compare
@eileenmcnaughton @twomice I have a doubt - Does Civi retain manually added a contact in a smart group when contact-cache is rebuilt based on saved search criteria? |
@monishdeb As a general point, manually added contacts in a smart group should be retained when group_contact_cache is rebuilt, because the manually added/removed contacts are stored in group_contact. I'm sure you know that, so is your question whether the manually added contacts are also in group_contact_cache? Or is it a question specific to the code changes in this PR? |
@davejenx thanks for your reply. Sorry to put this silly question w/o doing enough research on my end. Will provide my feedback about this PR soon. |
I tested this on an AUG install, I didn't see any obvious performance issues and i was able to confirm it now allows for public smart groups to show in the list. I think this is good to be merged |
@eileenmcnaughton or @monishdeb , any possibility to merge this in based on Seamus's review? |
Works fine in my local and from code pov its ok to merge. |
Thanks @monishdeb ! |
Overview
Changes the Contact Dashboard so that the user can join and leave publicly visible Smart Groups, just as they can on Profiles, as shown in this Profile screenshot:
![profile_before](https://user-images.githubusercontent.com/759449/29899726-c525c026-8db2-11e7-813a-1101448de1fb.png)
Before
Without this change, all Smart Groups are excluded from the Contact Dashboard, as shown here:
![before](https://user-images.githubusercontent.com/759449/29899732-d30c8058-8db2-11e7-8d26-f9d41c43e05f.png)
After
After this change, Smart Groups which are publicly visible are shown for joining and leaving on the Contact Dashboard, just as on Profiles, as shown here:
![after](https://user-images.githubusercontent.com/759449/29899742-e92a197c-8db2-11e7-837d-044d8825afdb.png)
Technical Details
Comments
Nothing of note.