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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Warning: mysqli_error()
Pages: [1]

Author Topic: Warning: mysqli_error()  (Read 1349 times)

biologyben

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Wordpress 4.0
Warning: mysqli_error()
October 22, 2014, 09:09:32 pm
I just installed CiviCRM 4.5.2 on a fully up-to-date wordpress.  Things are going well, but anytime I search from the navagation bar in the back end I recieve this message.

Code: [Select]
Warning: mysqli_error() expects parameter 1 to be mysqli, resource given in /webroot/b/g/bgcpa001/primary/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 224

I can search just fine from the 'Search > Contacts" link however.  Any advice?
« Last Edit: October 23, 2014, 05:18:34 am by biologyben »

biologyben

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Wordpress 4.0
Re: Warning: mysqli_error()
October 30, 2014, 04:48:35 pm
I see there are no replys - Is this that odd of an error message, too simple to solve, or did I not explain this well enough?

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: Warning: mysqli_error()
October 31, 2014, 11:49:20 am
It's well-explained, but I've never seen that before, and I work with lots of Civi installs - so I'm guessing it's a pretty rare/odd issue, which is why you haven't seen responses. Sorry!
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

biologyben

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Wordpress 4.0
Re: Warning: mysqli_error()
October 31, 2014, 05:44:03 pm
I have not installed any admin theme that would likely be impacting this & I double checked that none of my plug-ins are on the known conflict list.  Odd that most everything seems to work still - the the search dropdown box has odd formatting that I assumed was a just CSS conflict, but now I assume they are inter-related.

It also had this error after the mysqli error message:

     Sorry but we are not able to provide this at the moment.
     QuickForm Error: nonexistent html element

I thought I'd share a code snippet from the indicated line.  This is on a Wordpress 4.0 Multisite install with CiviCrm 4.5.2.  I marked the line that is indicated in the error message.

Code: [Select]
    elseif (function_exists('mysqli_error')) {
      $dao = new CRM_Core_DAO();

      // we do it this way, since calling the function
      // getDatabaseConnection could potentially result
      // in an infinite loop
      global $_DB_DATAOBJECT;
      if (isset($_DB_DATAOBJECT['CONNECTIONS'][$dao->_database_dsn_md5])) {
        $conn = $_DB_DATAOBJECT['CONNECTIONS'][$dao->_database_dsn_md5];
        $link = $conn->connection;

        if (mysqli_error($link))                                                                          <---- (THIS IS LINE 224 mentioned in the error)
          $mysql_error = mysqli_error($link) . ', ' . mysqli_errno($link);
          $template->assign_by_ref('mysql_code', $mysql_error);

          // execute a dummy query to clear error stack
          mysqli_query($link, 'select 1');
        }
      }
    }
« Last Edit: October 31, 2014, 05:58:31 pm by biologyben »

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Warning: mysqli_error()
November 01, 2014, 04:35:58 am
Are you getting any errors in your browser console.  I don't think the mysqli error is the root of the problem, the problem is something else and that is just the end result because of another error.  But it seems to be something specific to your environment, not a bug in Civi, so it is hard to guess what might be the cause without looking at your site specifically.  Do you have any customizations in place on your Civi install?
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

biologyben

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Wordpress 4.0
Re: Warning: mysqli_error()
November 01, 2014, 12:18:27 pm
No - using chrome locally and have tried ie - same problem.  In chrome, the console log doesn't show any errors related to this.

I do have the same issue with the CiviCRM News dashlet  that you see on the WP Demo site though.  The demo searches correctly however.  (I was able to simply remove these)

I'll turn error logging on with CC but that didn't capture any concerns on the webpage and there is no indication in the wiki or book on the log file location on WordPress sites - I've searched for any path including "ConfigAndLog" in the Civicrm plug-in directory, but no luck yet - if I find it, I'll post any logs it shows.

I'll also start turning off plugins and see if it changes...


biologyben

  • I post occasionally
  • **
  • Posts: 56
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Wordpress 4.0
Re: Warning: mysqli_error()
November 01, 2014, 05:58:53 pm
plugins had no change...

There was an additional error message with logging turned on: 

Code: [Select]
Additional Details:
Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -3
    [message] => QuickForm Error: nonexistent html element
    [mode] => 16
    [debug_info] => Element 'country' does not exist in HTML_QuickForm::getElementValue()
    [type] => HTML_QuickForm_Error
    [user_info] => Element 'country' does not exist in HTML_QuickForm::getElementValue()
    [to_string] => [html_quickform_error: message="nonexistent html element" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="QuickForm Error: " info="Element 'country' does not exist in HTML_QuickForm::getElementValue()"]
)

So, using this information, I turned on the 'country' checkbox in admin>admin console>address settings>address editing and now it works fine.  This is very strange - I tried to replicate in the demo with no luck.
« Last Edit: November 01, 2014, 08:06:15 pm by biologyben »

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: Warning: mysqli_error()
November 03, 2014, 10:05:13 am
The demo site is currently on 4.5.3, I wonder if there was something fixed that resolved this issue and that is why you can't recreate it.  I don't have a 4.5.2 site that I can test on right now othrewise I would see.  I'm glad that you were able to resolve it though.
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

philiphart

  • I’m new here
  • *
  • Posts: 15
  • Karma: 0
Re: Warning: mysqli_error()
February 24, 2015, 03:42:41 am
Our site has just been upgraded (by CiviHosting) to 4.5.6 and we now experience exactly the same pair of error messages.

The mysqli error when saving an event settings page, and the QuickForm html error when I try to register for the event.

In our case, the State/Province setting is already turned on in Administer-Address Settings and the error does not change whether it is turned on or off.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Warning: mysqli_error()
February 24, 2015, 04:47:46 am
philiphart, I looked at your site with debugging enabled and the full error message is:

Code: [Select]
Element 'state_province-Primary' does not exist in HTML_QuickForm::getElement()

I also noticed that if I visit the URL

 /civicrm/event/manage/settings?reset=1&action=update&id=21

on your site and click on Online Registration I see this message:

Code: [Select]
The selected profile is using a custom field which is not assigned to the "Event" being configured.
I don't know if that's related however.
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.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Warning: mysqli_error()

This forum was archived on 2017-11-26.