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) »
  • Ability to select a page of contacts at one time is broken
Pages: [1]

Author Topic: Ability to select a page of contacts at one time is broken  (Read 1355 times)

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Ability to select a page of contacts at one time is broken
September 15, 2014, 09:42:28 am
The ability to select contacts using the button at the top of a list (under Reset All Selections) is working in some cases and not others eg

- One search resulted in 7 contacts. When I clicked the select button at the top of the list the Selected Records Only button showed 7 (ie the entire list as it should do)
- Another search resulted in 103 contacts. 100 were shown on one page. When I clicked the select button for that page the Selected Records Only button showed 0 records selected. However, when I individually selected 5 records from the same list, this showed correctly as 5 Selected Records Only.

This currently means that when I'm batch updating I have to individually select all 100 records from a page! There is a database error relating to this but it just says that there is an empty database query.

Any thoughts? 

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Ability to select a page of contacts at one time is broken
September 15, 2014, 09:50:59 am
Hi Lindsey,

Are you actually using Civi 4.1.5 like your profile says?  If so, I remember there being a problem that was cleaned up in later versions that fixed this.  If not, you may want to update your profile and/or let us know what version of Civi we're discussing.

This problem happened pretty regularly in the 4.3 series - and I thought it was fixed in the 4.4 series, but I had a similar problem last night on 4.4.6.

Two thoughts:
* It sounds like you might not have debugging enabled (Administer menu > System Settings > Debugging and Error Handling).  You may want to enable debugging (and backtrace) and see if the "empty database query" error is more verbose with debugging turned on.
* Civi 4.5 is going to be released...well, I don't like to make predictions, but all signs point to this Wednesday.  Since the search results screen has been completely overhauled, I'd expect errors like this to go away after an upgrade.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

LindseyM

  • I post frequently
  • ***
  • Posts: 229
  • Karma: 8
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3.6
Re: Ability to select a page of contacts at one time is broken
September 16, 2014, 03:21:58 am
Thanks Jon. We're actually using 4.4.6 so I must update my details! You mentioned you had the same problem last night on 4.4.6  Did you manage to resolve that or was it intermittent and it sorted itself out?

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Ability to select a page of contacts at one time is broken
September 16, 2014, 08:02:50 am
I couldn't replicate the problem - but I did notice that there was a noticeable delay between checking off a contact and the number of contacts changing on that same site.  Not 100% sure what to make of it!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Ability to select a page of contacts at one time is broken
September 16, 2014, 09:03:20 am
LindseyM, can you check in Firebug for any JS errors?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jcasharpe

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 5
    • Woodlands Church
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10.0.13
  • PHP version: 5.5
Re: Ability to select a page of contacts at one time is broken
September 16, 2014, 12:32:31 pm
Hershel, this is the error from the Civicrm log in response to trying to make the selection:

Sep 16 15:50:17  [info] $backTrace = #0 /var/www/drupal7/sites/all/modules/civicrm/CRM/Core/Error.php(197): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /var/www/drupal7/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /var/www/drupal7/sites/all/modules/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), " [nativecode=1065 ** Query was empty]")
#4 /var/www/drupal7/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), " [nativecode=1065 ** Query was empty]")
#5 /var/www/drupal7/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, " [nativecode=1065 ** Query was empty]", "DB_Error", TRUE)
#6 /var/www/drupal7/sites/all/modules/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-1, NULL, NULL, NULL, "1065 ** Query was empty")
#7 /var/www/drupal7/sites/all/modules/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()
#8 /var/www/drupal7/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("")
#9 /var/www/drupal7/sites/all/modules/civicrm/packages/DB/DataObject.php(2421): DB_common->query("")
#10 /var/www/drupal7/sites/all/modules/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("")
#11 /var/www/drupal7/sites/all/modules/civicrm/CRM/Core/DAO.php(160): DB_DataObject->query("")
#12 /var/www/drupal7/sites/all/modules/civicrm/CRM/Core/DAO.php(908): CRM_Core_DAO->query("", TRUE)
#13 /var/www/drupal7/sites/all/modules/civicrm/CRM/Core/BAO/PrevNextCache.php(338): CRM_Core_DAO::executeQuery(NULL, (Array:0))
#14 /var/www/drupal7/sites/all/modules/civicrm/CRM/Contact/Page/AJAX.php(1164): CRM_Core_BAO_PrevNextCache::markSelection("civicrm search 5acb59ee271fc795735d9be079a7243f_9713", "select")
#15 [internal function](): CRM_Contact_Page_AJAX::selectUnselectContacts((Array:3))
#16 /var/www/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php(289): call_user_func((Array:2), (Array:3))
#17 /var/www/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php(72): CRM_Core_Invoke::runItem((Array:12))
#18 /var/www/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#19 /var/www/drupal7/sites/all/modules/civicrm/drupal/civicrm.module(456): CRM_Core_Invoke::invoke((Array:3))
#20 [internal function](): civicrm_invoke("ajax", "markSelection")
#21 /var/www/drupal7/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
#22 /var/www/drupal7/index.php(21): menu_execute_active_handler()
#23 {main}

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Ability to select a page of contacts at one time is broken
September 17, 2014, 02:44:36 am
Those are the backend errors. I am asking if you can use Firebug for Firefox and look for any JS errors on the page.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jcasharpe

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 5
    • Woodlands Church
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10.0.13
  • PHP version: 5.5
Re: Ability to select a page of contacts at one time is broken
September 17, 2014, 02:10:14 pm
From memory the only error was in response to getting the 500 response back from the ajax request, hence why posting the backend log seemed relevant. Either way the fact that the code is generating a empty query is surely a bug?

jcasharpe

  • I post occasionally
  • **
  • Posts: 57
  • Karma: 5
    • Woodlands Church
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7
  • MySQL version: MariaDB 10.0.13
  • PHP version: 5.5
Re: Ability to select a page of contacts at one time is broken
September 17, 2014, 02:20:01 pm
Yes, the bug is that CRM_Core_BAO_PrevNextCache::markSelection can be called with the second parameter set to anything other than 'unselect' and the third parameter being default (i.e. null) and this results in $sql not getting set, resulting in passing a NULL as the sql string to the database query.

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: Ability to select a page of contacts at one time is broken
September 17, 2014, 02:40:28 pm

hey james:

can you please create a PR and attach it to the issue for this bug

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

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Ability to select a page of contacts at one time is broken
January 27, 2015, 12:39:01 am
I'm still seeing this problem with 4.5.5 running on both Drupal 6 and Drupal 7 sites, but I can't replicate it on the demo site (which seems to be running 4.5.6). Has this been resolved with 4.5.6?
Graham Mitchell
http://mc3.coop

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Ability to select a page of contacts at one time is broken
January 27, 2015, 09:33:30 am
Typically when I see this issue, it's not version-specific.  It's because, e.g., the Drupal theme has its own version of jQuery running that's futzed with CiviCRM.  Check your Developer Console in Firefox/Chrome and see if there are clues specific to your install?
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

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: Ability to select a page of contacts at one time is broken
January 27, 2015, 02:02:58 pm
we hit the original post issue of selecting all on a page of 50 and it still showing as 0

our research/solution was that suhosin.get.max_value_length  needed increasing

which i think is what we flagged here http://forum.civicrm.org/index.php/topic,32298.0.html
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

Upperholme

  • Administrator
  • Ask me questions
  • *****
  • Posts: 568
  • Karma: 8
    • MC3
  • CiviCRM version: 4.x
  • CMS version: Drupal 6.x/7.x, Wordpress, Joomla
Re: Ability to select a page of contacts at one time is broken
January 28, 2015, 01:15:24 am
Thanks Jongold and petednz for getting back on this one.

I did some tests using the firebug console. Here's what I see:

If I have a page showing 25 contacts and I click the 'select all rows' tickbox:
The response I get is: {"getCount":25}

If I change the page so that it is showing 50 contacts, or 75, or 100, I get:

Quote
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>
  <title></title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <base href="/sites/all/modules/civicrm/" />
  <style type="text/css" media="screen">@import url(/sites/all/modules/civicrm/css/civicrm.css);</style>
</head>
<body>
<div id="crm-container" class="crm-container" lang="en" xml:lang="en">
<div class="messages status no-popup">  <div class="icon red-icon alert-icon"></div>
 <span class="status-fatal">Sorry but we are not able to provide this at the moment.</span>
    <div class="crm-section crm-error-message"></div>
            <hr style="solid 1px" />
        <div class="crm-section crm-error-message">DB Error: unknown error</div>
            <p><a href="http://www.dublinfood.coop/" title="Main Menu">Return to home page.</a></p>
</div>
</div>
<script language="JavaScript">
function toggle( element ) {
    var className = element.className;
    if ( className  == 'crm-accordion-wrapper collapsed crm-fatal-error-details-block') {
        element.className = 'crm-accordion-wrapper  crm-fatal-error-details-block';
    } else {
        element.className = 'crm-accordion-wrapper collapsed crm-fatal-error-details-block';
    }
}
</script>

</body>
</html>

and in the log I see:

Quote
Jan 28 08:59:00  [info] $Fatal Error Details = Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -1
    [message] => DB Error: unknown error
    [mode] => 16
    [debug_info] =>  [nativecode=1065 ** Query was empty]
    [type] => DB_Error
    [user_info] =>  [nativecode=1065 ** Query was empty]
    [to_string] => [db_error: message="DB Error: unknown error" code=-1 mode=callback callback=CRM_Core_Error::handle prefix="" info=" [nativecode=1065 ** Query was empty]"]
)


Jan 28 08:59:00  [info] $backTrace = #0 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Core/Error.php(239): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/dublin/sites/default/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/dublin/sites/default/sites/all/modules/civicrm/packages/DB.php(975): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), " [nativecode=1065 ** Query was empty]")
#4 /home/dublin/sites/default/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), " [nativecode=1065 ** Query was empty]")
#5 /home/dublin/sites/default/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, " [nativecode=1065 ** Query was empty]", "DB_Error", TRUE)
#6 /home/dublin/sites/default/sites/all/modules/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-1, NULL, NULL, NULL, "1065 ** Query was empty")
#7 /home/dublin/sites/default/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/dublin/sites/default/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("")
#9 /home/dublin/sites/default/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("")
#10 /home/dublin/sites/default/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("")
#11 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("")
#12 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Core/DAO.php(1116): CRM_Core_DAO->query("", TRUE)
#13 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Core/BAO/PrevNextCache.php(397): CRM_Core_DAO::executeQuery(NULL, (Array:0))
#14 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Contact/Page/AJAX.php(1023): CRM_Core_BAO_PrevNextCache::markSelection("civicrm search 89c59229bc1bcc570840639328750b0c_7107", "select")
#15 [internal function](): CRM_Contact_Page_AJAX::selectUnselectContacts()
#16 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Core/Invoke.php(296): call_user_func((Array:2))
#17 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:12))
#18 /home/dublin/sites/default/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))
#19 /home/dublin/sites/default/sites/all/modules/civicrm/drupal/civicrm.module(457): CRM_Core_Invoke::invoke((Array:3))
#20 [internal function](): civicrm_invoke("ajax", "markSelection")
#21 /home/dublin/sites/default/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2))
#22 /home/dublin/sites/default/index.php(21): menu_execute_active_handler()
#23 {main}[/quote]

The server is running Debian with PHP 5.3.3-7+squeeze23
I had upped the suhosin.get_max_value_length to 8192

Any insight most welcome, as this bug is a royal pain in the butt for my users.

(I'm probably upgrading the server in the not too distant future to a later version of PHP, which may resolve this. On checking the requirements on the wiki, it states 5.3.10+ as a minimum for PHP, so maybe it's time to prioritise that update.)
Graham Mitchell
http://mc3.coop

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: Ability to select a page of contacts at one time is broken
January 28, 2015, 10:44:27 am
pretty sure it turned out that our probs were all on older servers too
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Ability to select a page of contacts at one time is broken

This forum was archived on 2017-11-26.