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) »
  • Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
Pages: [1]

Author Topic: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"  (Read 1403 times)

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
August 20, 2010, 10:36:14 am
Earlier this week we went through a Drupal 5.x to 6.x / CiviCRM 2.0.7 to 3.2.1 upgrade.

Upon executing a query at Home » CiviCRM » Find Contacts we are getting a red error box with several such lines as this one:

Code: [Select]
warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /srv/www/sites/orgname.org/www/sites/all/modules/civicrm/CRM/Contact/BAO/Contact/Utils.php on line 69.

Suggestions please? Thanks!
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

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: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
August 20, 2010, 11:59:17 am

can u cut-n-paste the values of your civicrm_contact_type table

select * from civicrm_contact_type;

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

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
August 20, 2010, 02:02:11 pm
Code: [Select]
select * from civicrm_contact_type;
+----+--------------+--------------+-------------+-----------+-----------+-----------+-------------+
| id | name         | label        | description | image_URL | parent_id | is_active | is_reserved |
+----+--------------+--------------+-------------+-----------+-----------+-----------+-------------+
|  1 | Individual   | Individual   | NULL        | NULL      |      NULL |         1 |           1 |
|  2 | Household    | Household    | NULL        | NULL      |      NULL |         1 |           1 |
|  3 | Organization | Organization | NULL        | NULL      |      NULL |         1 |           1 |
+----+--------------+--------------+-------------+-----------+-----------+-----------+-------------+
3 rows in set (0.00 sec)
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

swettling

  • Guest
Re: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
August 22, 2010, 01:03:32 pm
I am running 3.2.0 and having the same error show up.

id   name   label   description   imageurl   parentid   is_active   is reserved
1   Individual   Individual            1   1
2   Household   Household            1   1
3   Organization   Organization            1   1
5   Exhibitor   Exhibitor         1   1   

Any thoughts?


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: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
August 22, 2010, 01:44:36 pm

can u apply this patch and see if it works:

Code: [Select]
svn diff CRM/Contact/BAO/Contact/Utils.php
Index: CRM/Contact/BAO/Contact/Utils.php
===================================================================
--- CRM/Contact/BAO/Contact/Utils.php   (revision 29331)
+++ CRM/Contact/BAO/Contact/Utils.php   (working copy)
@@ -55,6 +55,7 @@
             require_once 'CRM/Contact/BAO/ContactType.php';
             CRM_Contact_BAO_ContactType::retrieve( $params, $typeInfo );
 
+            $typeInfo = array( );
             if (  CRM_Utils_Array::value( 'image_URL', $typeInfo ) ) {
                 $imageUrl = $typeInfo['image_URL'];
                 $config   = CRM_Core_Config::singleton( );

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

swettling

  • Guest
Re: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
August 22, 2010, 02:39:15 pm
I seem to have resolved mine.  There was an invalid character in my administrative contact record contact_sub_type had some garbage in it.  I cleared it out and the error has vanished.

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
August 23, 2010, 06:46:05 am
Quote from: Donald Lobo on August 22, 2010, 01:44:36 pm
can u apply this patch and see if it works:

Indeed that patch seems to correct the trouble right away. We will bang on it for a while and I will reply again one way or the other.

Thanks very much!!!  ;D
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Dave Smith

  • I post occasionally
  • **
  • Posts: 80
  • Karma: 1
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
Re: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
September 10, 2010, 04:01:17 pm
I have a similar error message coming up:

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/xxxx/public_html/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 182.

Would the patch referred to solve this error to?

Also, I note that a bug was introduced into the 3.2.3 release and there is a patch avaialble. Is there a connection between this bug and my reported error here?

Thanks
"The philosophers have only interpreted the world, in various ways; the point is to change it." ... Marx

mdlueck

  • Ask me questions
  • ****
  • Posts: 382
  • Karma: 4
  • CiviCRM version: 4.7.24
  • CMS version: Drupal 6.x
  • MySQL version: 5.5.54
  • PHP version: 5.3.10
Re: Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"
October 03, 2010, 01:50:38 pm
Quote from: mdlueck on August 23, 2010, 06:46:05 am
We will bang on it for a while and I will reply again one way or the other.

This fix continues to work properly.

I have recently upgraded to 3.2.3 and I see that the line of code you suggested has been added, only slightly higher than I added it.

Thanks for getting it committed to 3.2.3.
--
Michael Lueck
Lueck Data Systems
http://www.lueckdatasystems.com/

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Red error after 2.0.7 -> 3.2.1 upgrade "The second argument should be either an"

This forum was archived on 2017-11-26.