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) »
  • array_intersect_key()
Pages: [1]

Author Topic: array_intersect_key()  (Read 1837 times)

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
array_intersect_key()
October 06, 2009, 03:18:08 pm
Hello.  I have a brand new installation of civiCRM 3.0 (Drupal 6.14)

When I create a test event I get the following error on the live registration page:

Code: [Select]
warning: array_intersect_key() [function.array-intersect-key]: Argument #1 is not an array in
/home/catastrophic1/catastrophictheatre.com/sites/all/modules/civicrm/CRM/Event/Form/Registration.php on line 601.

A quick search on the forums reveals there have been a couple other folks with similar errors based on using older versions of php.

However:

1. I have confirmed that my sever is running php 5.2.9
2. The demo events that were installed with the civiCRM package do not have this error on their live registration pages.

Can anyone suggest what is wrong here?  Any help would be appreciated.

Thanks.

P.S.  Here is the complete php version info if it helps at all:
Code: [Select]
PHP 5.2.9 (cli) (built: Jun 12 2009 19:19:05)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

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: array_intersect_key()
October 06, 2009, 04:03:05 pm
i just checked the code, and if i had to guess you are using a profile which is included in the event. Can you list all the fields in the profile?

I see a bug with the code, and i just want to confirm it with your event setup

can u also try applying this patch:

Code: [Select]
Index: CRM/Event/Form/Registration.php
===================================================================
--- CRM/Event/Form/Registration.php     (revision 24056)
+++ CRM/Event/Form/Registration.php     (working copy)
@@ -596,12 +596,14 @@
                         unset( $fields[$fieldName] );
                     }
                 }
+
+                // http://forum.civicrm.org/index.php/topic,10220.0.html
+                if ( array_intersect_key( $fields, $fieldsToIgnore ) ) {
+                    $fields = array_diff_key( $fields, $fieldsToIgnore );
+                    CRM_Core_Session::setStatus( "Some of the profile fields cannot be configured for this page." );
+                }
             }
-           
-            if ( array_intersect_key( $fields, $fieldsToIgnore ) ) {
-                $fields = array_diff_key( $fields, $fieldsToIgnore );
-                CRM_Core_Session::setStatus( "Some of the profile fields cannot be configured for this page." );
-            }
+
             $addCaptcha = false;
             $this->assign( $name, $fields );
             if ( is_array( $fields ) ) {

and see if it work

lobo
« Last Edit: October 06, 2009, 04:09:33 pm by Donald 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

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: array_intersect_key()
October 06, 2009, 04:30:41 pm
The event included the profile "New Individual" in a form unmolested by me.  Fields were:

First Name (Individual)
Last Name (Individual)
Email Address (Contact)

I did confirm that removing the profile from the event eliminated the problem, but I have not tried the patch.

Thanks for your help.  I hope this clears it up.

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: array_intersect_key()
October 06, 2009, 05:33:25 pm
Patch also seems to work.

Thanks again.

kmarkley

  • I post frequently
  • ***
  • Posts: 178
  • Karma: 14
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7.24
  • MySQL version: 5.1.56
  • PHP version: 5.3.27
Re: array_intersect_key()
October 06, 2009, 06:02:36 pm
After installing the patch, I don't see a profile on new account and account edit pages for drupal users.  

Restoring the original Register.php file restores the profiles to drupal account pages.

Help?
« Last Edit: October 06, 2009, 07:02:15 pm by kmarkley »

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: array_intersect_key()
October 06, 2009, 07:26:57 pm

can we get ssh access to your box. if so can you please get on IRC

We'll also need the ability to edit the civicrm files so we can add debug statements etc. A few other folks have reported this, so most likely it is a bug in the system

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

denverdataman

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 2
    • Denver DataMan Website
  • CiviCRM version: Several
  • CMS version: Drupal 6/7
Re: array_intersect_key()
October 18, 2009, 11:51:21 am
I upgraded to CiviCRM 3.0.1 last night and I have this same problem. Before I apply this patch I wanted to make sure there nave not been other updates made to this issue that I should be aware of.

Thanks,
Steve
Steve Kessler
Owner and Lead Consultant of Denver DataMan

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: array_intersect_key()
October 18, 2009, 02:44:16 pm

kmarkley could not reproduce the issue when we ssh'ed into his box.

If you have the issue, can you please contact us on IRC and we can take a look. Please check and follow ALL the instructions at:

http://wiki.civicrm.org/confluence/display/CRMDOC/SSH+Access+Requirements

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

denverdataman

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 2
    • Denver DataMan Website
  • CiviCRM version: Several
  • CMS version: Drupal 6/7
Re: array_intersect_key()
October 19, 2009, 10:03:06 am
After talking to Lobo (thanks!) it looks like the problem is related to a patch that will be in 3.0.2 for profiles.

-Steve
Steve Kessler
Owner and Lead Consultant of Denver DataMan

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

This forum was archived on 2017-11-26.