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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Weird error when searching, "last page" doesn't display the last contacts
Pages: [1]

Author Topic: Weird error when searching, "last page" doesn't display the last contacts  (Read 1912 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Weird error when searching, "last page" doesn't display the last contacts
July 16, 2009, 09:48:57 am
I do a contact search in my 2.2.6 civicrm for ALL contacts and it displays X results.

However when I click the "LAST" button on the results page the results end at the letter "V".  Our contacts go all the way to the letter "Z".   In other words, CiviCRM thinks it is displaying the last of our results on its "last" page, but it in fact is not, there are approx 30-40 results left undisplayed.  If I click the letter "Z" in the alphabet bar, I will see the contacts who are missing from the results.

My guess is because this website has had a lot of importing and changing of contacts as well as deleting contacts that some "ghost rows" are messing up the count(*) of the search query.

Anyone experienced anything like this before?  I can't duplicate it on the demo site cause the contacts there are only about 100 of them, but I will offer a login to our site to any of the core CiviCRM developers if you want to take a look at this bug.

Thanks,
Stoob
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Weird error when searching, "last page" doesn't display the last contacts
July 16, 2009, 12:28:00 pm
A good start to debugging this would be to use phpMyAdmin or MySQL from the console to get a count of contact records from the DB:

select count(id) as contact_count from civicrm_contact;

... and compare that to what you see in the search results.
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Weird error when searching, "last page" doesn't display the last contacts
July 16, 2009, 12:46:16 pm
dbQuery and CiviCRM results both show 939.  However, the last ~30 are not visible on the "last" page of the results stops somewhere in the letter "V".

Interestingly, if the number of rows per page is set to 50 the last page cuts off somewhere in the letter V.  However if the rows per page is 100, it cuts off somewhere in the letter Y.  In both cases, people are still missing, as we have several Z contacts.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Weird error when searching, "last page" doesn't display the last contacts
July 17, 2009, 01:27:06 pm
Not sure where to go from here - might be best to get on IRC and see if u can get help debugging.
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Weird error when searching, "last page" doesn't display the last contacts
August 03, 2009, 05:51:58 pm
Seems to be a continuing problem, have tried but cannot replicate on the demo site.  I'll linger around IRC hoping to get some insight.

In the meantime check out this fascinating screenshot.

Try CiviTeacher: the online video tutorial CiviCRM learning library.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Weird error when searching, "last page" doesn't display the last contacts
August 07, 2009, 10:10:18 am
Hey guys,

I've spent about 10 hours in IRC over the last 4 days, and asked nicely, even humorously, for help repeatedly on this issue.

I have gotten no response at all from anyone or any offers to help.  At best I am confused.

I really am trying to help make CiviCRM better here, and I believe I have found a bug than may manifest itself not in your controlled demo site environment, which bugs occasionally do.  I have found them and helped you debug things like this before, legitimate bugs.

Can we please work together here to uncover the cause of this bug?  I'm ready to help, I hope you are too!

« Last Edit: August 07, 2009, 10:12:20 am by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Weird error when searching, "last page" doesn't display the last contacts
August 07, 2009, 03:59:06 pm
Hey stoob - I do recall hitting this problem a fair while ago - will do a search through my posts and see if i can pick it. i was going to say it has something to do with some records being counted twice eg for people who have two primary phones or emails, so may be worth just seeing if you have any such undesiriables.
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Weird error when searching, "last page" doesn't display the last contacts
August 07, 2009, 04:24:31 pm
Thx peter. Kurund just finished working w/ Stoob on this over IRC and I think they solved it (and I think it was indeed related to multiple primary phone numbers for some contacts).
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Weird error when searching, "last page" doesn't display the last contacts
August 07, 2009, 09:00:43 pm
Yes you are both correct.  I really appreciate Kurund's help with this.  I am going to post the query he used on here shortly when I get it from him..  It turns out the particular site in question had been started when it was 2.0.5 and upgraded many times since then.  Somewhere along the line over 50 contacts had multiple "primary" phone numbers and emails, which is a "no-no".  Also possibly an issue is phone numbers and emails with a NULL contact_id 

Kurund's theory is this issue was either a bug of 2.0 or a bug of the 2.0 > 2.1 upgrade process.

Regardless, we were able to fix most of the pagination issues.  There are still a few left (I'm off by 5 contacts) but the majority of the work is done.

Thanks again everyone.  I will most more when I know more.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Weird error when searching, "last page" doesn't display the last contacts
August 08, 2009, 01:26:55 pm
we were definitely having this issue pre 2.1
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Weird error when searching, "last page" doesn't display the last contacts
August 23, 2009, 10:47:52 pm
Stoob:

I was on vacation for few weeks :).  Here is the query

Quote
SELECT DISTINCT(contact_a.id) as contact_id, contact_a.sort_name  as `sort_name`, civicrm_phone.id as phone_id  FROM civicrm_contact contact_a LEFT JOIN civicrm_address ON ( contact_a.id = civicrm_address.contact_id AND civicrm_address.is_primary = 1 ) LEFT JOIN civicrm_state_province ON civicrm_address.state_province_id = civicrm_state_province.id  LEFT JOIN civicrm_country ON civicrm_address.country_id = civicrm_country.id  LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_email.is_primary = 1)  LEFT JOIN civicrm_phone ON (contact_a.id = civicrm_phone.contact_id AND civicrm_phone.is_primary = 1)  LEFT JOIN civicrm_im ON (contact_a.id = civicrm_im.contact_id AND civicrm_im.is_primary = 1)  LEFT JOIN civicrm_worldregion ON civicrm_country.region_id = civicrm_worldregion.id  LEFT JOIN civicrm_option_group option_group_gender ON (option_group_gender.name = 'gender') LEFT JOIN civicrm_option_value gender ON (contact_a.gender_id = gender.value AND option_group_gender.id = gender.option_group_id)  WHERE  ( 1 )    ORDER BY contact_a.sort_name, contact_a.id asc  \G;

When you fire this query you will get list of all phone_id's and you will have to manually check for duplicate phone_id and accordingly update the contact.

HTh
Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Weird error when searching, "last page" doesn't display the last contacts

This forum was archived on 2017-11-26.