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 CiviEvent (Moderator: Yashodha Chaku) »
  • CiviEvent Error - Warning for PHP
Pages: [1]

Author Topic: CiviEvent Error - Warning for PHP  (Read 588 times)

smnnkd

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.1.65
  • PHP version: 5.3.10
CiviEvent Error - Warning for PHP
April 05, 2013, 10:09:05 am
All my events seems to get the same error just above the [Confirmation] button.  The error is; "Warning: Invalid argument supplied for foreach() in /home/cehaor5/public_html/administrator/components/com_civicrm/civicrm/CRM/Event/Form/Registration/Register.php on line 269". Any insight appreciated.  I am using a "Contact" and a Price Set for the Event.

Here is the code for this section.  Line 269 is highlighted.
// add this event's default participant role to defaults array
    // (for cases where participant_role field is included in form via profile)
    if ($this->_values['event']['default_role_id']) {
      $this->_defaults['participant_role'] = $this->_defaults['participant_role_id'] = $this->_values['event']['default_role_id'];
    }
    if ($this->_priceSetId) {
      foreach ($this->_feeBlock as $key => $val) {
        foreach ($val['options'] as $keys => $values) {
          if ($values['is_default'] &&
            !CRM_Utils_Array::value('is_full', $values)
          ) {

            if ($val['html_type'] == 'CheckBox') {
              $this->_defaults["price_{$key}"][$keys] = 1;
            }
            else {
              $this->_defaults["price_{$key}"] = $keys;
            }
          }
        }
      }
    }

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: CiviEvent Error - Warning for PHP
April 05, 2013, 12:14:10 pm

is this 4.3? can u set up a similar event on our demo servers and see if u get the same warning

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

smnnkd

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.1.65
  • PHP version: 5.3.10
Re: CiviEvent Error - Warning for PHP
April 06, 2013, 10:31:55 am
Yes, we are running CiviCRM 4.3. 
I will try to duplicate on the demo server.

smnnkd

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
  • CiviCRM version: 4.3
  • CMS version: Joomla 2.5.8
  • MySQL version: 5.1.65
  • PHP version: 5.3.10
Re: CiviEvent Error - Warning for PHP
April 08, 2013, 05:59:35 pm
I was unable to replicate on the server, but was able to determine the problem only occurs when there is a fee.  Free events are not affected (do not get the error).  The processing occurs, and the error is not fatal.  Any ideas appreciated.

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: CiviEvent Error - Warning for PHP
April 08, 2013, 07:48:41 pm

do u have the demo url where u tried to replicate it? we can check drupal db logs

the last time this happened, it was due to an ajax call, the demo server was fast enough that it rendered the page before the ajax call and hence we did not see the error, but i suspect the error is logged in the watchdog table

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

penguintrax

  • I post frequently
  • ***
  • Posts: 230
  • Karma: 2
  • CiviCRM version: 3.3x and 4.x depending on site
  • CMS version: Joomla 1.5 or 1.7 depending on site
  • MySQL version: 5.0.92-community
  • PHP version: 5.2.17
Re: CiviEvent Error - Warning for PHP
May 06, 2013, 11:00:13 am
For whatever this is worth, I'm seeing this in Joomla 2.5.10 and Civi 4.2.6

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • CiviEvent Error - Warning for PHP

This forum was archived on 2017-11-26.