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 »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1
Pages: [1]

Author Topic: Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1  (Read 1662 times)

jeffmikels

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1
March 06, 2012, 02:54:48 pm
I've upgraded Drupal and CiviCRM a number of times and have never seen this error, but after following all instructions on the CiviCRM website for upgrading my CiviCRM from 4.0.3 to 4.1.1, (after successfully completing a Drupal upgrade to 7.12), my Drupal site still works great, but after I enable the CiviCRM module, I get Fatal Errors. Drupal Admin pages load, but nothing else will load including CiviCRM pages.

The Drupal Error Log says:

Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /[DRUPAL]/includes/common.inc on line 2192 and defined in drupal_http_build_query() (line 477 of /[DRUPAL]/includes/common.inc).

[DRUPAL] refers to my drupal installation directory.

Can anyone help me resolve this?

jeffmikels

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
Re: Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1
March 06, 2012, 03:23:35 pm
I found a workaround, but it seems weird to me that I'm the only one facing this problem.

The workaround included changing drupal /includes/common.inc.

Apparently CiviCRM is sending a query string to drupal, but drupal expects an array. Here is my modified code starting from line 2188:

Code: [Select]
  // With Clean URLs.
  if (!empty($GLOBALS['conf']['clean_url'])) {
    $path = drupal_encode_path($prefix . $path);
    // MODIFIED BY JEFF
    // CIVICRM WAS SETTING QUERY TO A STRING BUT DRUPAL 7 WANTS AN ARRAY
    // DON'T KNOW IF THIS IS ALWAYS NEEDED, BUT IT DOESN'T SEEM TO HURT ANYTHING
    if ($options['query'] && is_array($options['query'])) {
    //if ($options['query']) {
      return $base . $path . '?' . drupal_http_build_query($options['query']) . $options['fragment'];
    }
    else {
      return $base . $path . $options['fragment'];
    }
  }
  // Without Clean URLs.

Is this a CiviCRM bug?

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: Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1
March 06, 2012, 05:13:27 pm

Can u track and trace where this call is being made. I checked the few places that we are aware of that calls the url( ) function and it sends in the right parameter

adding something like debug_print_backtrace( ) in the drupal code will help u narrow it down

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

jeffmikels

  • I’m new here
  • *
  • Posts: 26
  • Karma: 0
Re: Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1
March 07, 2012, 08:54:48 am
I have added the following debug code:

Code: [Select]
if ($options['query'] && ! is_array($options['query'])) {
  print "--------------OPTIONS PASSED INCORRECTLY-----------";
  print_r($options['query']);
  debug_print_backtrace( );
  die();
}


The output (without the full backtrace) is:

Code: [Select]
--------------OPTIONS PASSED INCORRECTLY-----------reset=1

Here is the backtrace:

Code: [Select]
#0  url(civicrm/menu/rebuild, Array ([query] => reset=1,[attributes] => Array ([title] => Use this link if the items in the top menu bar aren't displaying properly.),[html] => )) called at [[DRUPAL_ROOT]/includes/common.inc:2403]
#1  l(Fix Top Menu, civicrm/menu/rebuild, Array ([query] => reset=1,[attributes] => Array ([title] => Use this link if the items in the top menu bar aren't displaying properly.))) called at [[DRUPAL_ROOT]/includes/menu.inc:1629]
...
#19 menu_execute_active_handler() called at [[DRUPAL_ROOT]/index.php:21]

After looking at this data, I concluded that a menu link I had created in the sidebar quite some time ago was the culprit. Apparently, drupal or CiviCRM was validating that menu link on every page load, and that query was incompatible with Drupal 7.

I deleted that link from the Drupal Navigation Menu and have reverted common.inc to the original version, and everything is working fine.

Can anyone explain to me why an old menu link could cause the whole site to crash?

nae

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Play Australia
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 7.31
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1
May 29, 2012, 06:31:33 pm
Hello - I have got the exact same problem as this,

Would you please be able to advise where abouts in the drupal code I should insert the

debug_print_backtrace( )

so I can also find out what menu link may be causing this problem?

I was able to use the code in the common.inc file to bring my site back online. but it I try to run the civicrm upgrade script again, i get the same error.

Recoverable fatal error: Argument 1 passed to drupal_http_build_query() must be an array, string given, called in /Users/renaeechurches/Sites/PRAV/BACKUPS/April2012/public_html/includes/common.inc on line 2193 and defined in drupal_http_build_query() (line 477 of /Users/renaeechurches/Sites/PRAV/BACKUPS/April2012/public_html/includes/common.inc).

I have upgraded to drupal 7.14 and am using the Boiler Plate theme for Drupal 7.

many thanks.

nae

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
    • Play Australia
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 7.31
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1
June 01, 2012, 02:57:29 am
FWIW - i think that I got the wrong version of civicrm unpacked, as the error log under configandlog reads as follows:

May 30 11:21:16  [info] $Fatal Error Details = Array
(
    [message] => Your database is marked with an unexpected version number: 4.1.1. The automated upgrade to version 4.1.0 can not be run - and the 4.1.0 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. The database tools utility at http://wiki.civicrm.org/confluence/display/CRMDOC/Database+Troubleshooting+Tools may be helpful. You may want to revert to the codebase you were using prior to beginning this upgrade until you resolve this problem.
   
)

i was moving from drupal6 4.1.1 to the very latest civicrm for drupal7 but I must have selected the wrong one on the sourceforge page  :(

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Fatal Error after upgrading Drupal to 7.12 and CiviCRM to 4.1.1

This forum was archived on 2017-11-26.