CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.5 Release Testing »
  • [FIXED] Issue with smart group display in "Groups" tab / contact profile
Pages: [1]

Author Topic: [FIXED] Issue with smart group display in "Groups" tab / contact profile  (Read 516 times)

SemperFi

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 3
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: MySQL 5.5.16
  • PHP version: PHP 5.3.17
[FIXED] Issue with smart group display in "Groups" tab / contact profile
July 17, 2014, 04:20:50 am
Hello

Looking at 4.5b3 on Wordpress sandbox, I found an issue with displaying a smartgroup for this contact :
http://wordpress.sandbox.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/view&reset=1&cid=13&key=c44824960dfebb1a0ba41f0e2a34ef9a_9640&context=search

Enclosed in the screenshot with the error message :
Quote
Fatal error: Call to undefined function wp_get_current_user() in /home/webeditor/jenkins-node/workspace/buildkit-demos.civicrm.org/build/wp-sandbox/wp-includes/capabilities.php on line 1342

Also tried with other contacts, didn't work either. Seems that it doesn't handle case where user is not part of a smart group.
This is a guess.

Hope this helps
Thanks
« Last Edit: August 16, 2014, 01:13:53 pm by Coleman Watts »

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: [WP] Issue with smart group display in "Groups" tab / contact profile
July 18, 2014, 06:32:39 pm
Having same issue.  In my case it's getting malformed sql.

It's adding an and clause to make sure the contact hasn't been removed but it adds the clause after the order by.

The smart group is based upon the custom query "Contributions made in Year X and not Year "  (sites/all/modules/civicrm/CRM/Contact/Form/Search/Custom/ContribSYBNT.php).

Here is the sql it's barfing on:

CREATE TEMPORARY TABLE civicrm_temp_group_contact_cache955
(SELECT 65 as group_id, contact_a.id as contact_id
FROM civicrm_contact AS contact LEFT JOIN
         ncivicrm_contribution contrib_1 ON contrib_1.contact_id = contact.id LEFT JOIN         
         XG_CustomSearch_SYBNT xg ON xg.contact_id = contact.id
WHERE contrib_1.contact_id = contact.id
AND contrib_1.is_test = 0
AND contrib_1.receive_date >= 20120701000000
AND contrib_1.receive_date <= 20130630000000
AND xg.contact_id IS NULL
GROUP BY contact.id
ORDER BY donation_amount desc
AND contact_a.id NOT IN ( SELECT contact_id
                                       FROM civicrm_group_contact
                                       WHERE civicrm_group_contact.status = 'Removed'
                                       AND civicrm_group_contact.group_id = 65 )
)

I tried moving the last and clause to before the group by and manually run it but then it fails on not finding the table XG_CustomSearch_SYBNT.  I'm not sure if that is a temp table or on the fly view or what.  Maybe it would exists when running this.

I guess it makes some sense to be able to manually remove someone from a group like this but alas, I tried it and that fails as well with unknown column 'contact_a.id', so at the moment the extra "and not in" won't come up with anything anyway.

To see if we had any others that don't work, I disabled that one and the display smartgroup runs on all the other.  We have 61 smart groups. 

SemperFi

  • I post frequently
  • ***
  • Posts: 177
  • Karma: 3
  • CiviCRM version: 4.5.4
  • CMS version: Wordpress 4.0.1
  • MySQL version: MySQL 5.5.16
  • PHP version: PHP 5.3.17
Re: [WP] Issue with smart group display in "Groups" tab / contact profile
July 23, 2014, 06:22:49 am
Test done today - issue seems to have been solved.
Thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 4.5 Release Testing »
  • [FIXED] Issue with smart group display in "Groups" tab / contact profile

This forum was archived on 2017-11-26.