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) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Can't read the tags nor groups using the API ?
Pages: [1]

Author Topic: Can't read the tags nor groups using the API ?  (Read 3316 times)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Can't read the tags nor groups using the API ?
October 19, 2008, 11:44:48 pm
fetching contacts with return.tags=1

Get an error message:
Code: [Select]
SELECT contact_a.id as contact_id, GROUP_CONCAT(DISTINCT(civicrm_tag.name)) AS tags  FROM civicrm_contact contact_a LEFT JOIN civicrm_entity_tag ON ( civicrm_entity_tag.contact_id = contact_a.id )  LEFT  JOIN civicrm_tag ON civicrm_entity_tag.tag_id = civicrm_tag.id   LIMIT 0, 25  [nativecode=1140 ** Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause]


Same with return.groups=1

Code: [Select]
SELECT contact_a.id as contact_id, GROUP_CONCAT(DISTINCT(civicrm_group.name)) AS groups  FROM civicrm_contact contact_a LEFT JOIN civicrm_group_contact ON contact_a.id = civicrm_group_contact.contact_id  LEFT JOIN civicrm_group ON civicrm_group.id =  civicrm_group_contact.group_id   LIMIT 0, 25  [nativecode=1140 ** Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause]
Any idea how to ?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can't read the tags nor groups using the API ?
October 20, 2008, 06:14:51 am

can u add the following patch to CRM/Contact/BAO/Query.php

$this->_useGroupBy  = true;

to lines 528, 533 and 535 (i.e. after the 3 GroupConcat statements.

If that does work, can you please file an issue and attach the patch :). Can you also test and ensure that this patch does not break the 'export' of groups/tags

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Can't read the tags nor groups using the API ?
October 21, 2008, 10:55:31 am
Hi,

No more error, but nothing is fetched (not tag listed)

Any idea ?

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Can't read the tags nor groups using the API ?
October 21, 2008, 11:04:14 am

can u file an issue and attach your test snippet. we'll take a look and fix  before 2.1.2 (in the next 2 weeks or so)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Can't read the tags nor groups using the API ?
October 21, 2008, 11:19:02 am
Your requests are orders ;)

http://issues.civicrm.org/jira/browse/CRM-3736

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Can't read the tags nor groups using the API ?

This forum was archived on 2017-11-26.