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 CiviContribute (Moderator: Donald Lobo) »
  • (Resolved) Fatal Error: Call-time pass-by-reference removed Main.php line 1212
Pages: [1]

Author Topic: (Resolved) Fatal Error: Call-time pass-by-reference removed Main.php line 1212  (Read 29075 times)

Brylie Christopher Oxley

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 1
  • CiviCRM version: 4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.x
(Resolved) Fatal Error: Call-time pass-by-reference removed Main.php line 1212
October 28, 2012, 02:12:11 pm
We just created a contribution page. When we go to test-drive or view the live page, we get the following error:
Code: [Select]
FATAL error: Call-time pass-by-reference has been removed in .../sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php on line 1212
We are running:
PHP 5.4.3
Drupal 7.16
CiviCRM 4.2.1
« Last Edit: November 04, 2012, 06:37:45 pm by Brylie Oxley »
Brylie Oxley
http://brylie.gnumedia.org

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: Call-time pass-by-reference removed Main.php line 1212
October 28, 2012, 03:29:00 pm

is that a notice / warning or an error?

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

Brylie Christopher Oxley

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 1
  • CiviCRM version: 4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: Call-time pass-by-reference removed Main.php line 1212
October 28, 2012, 04:38:20 pm
Fatal Error: Call-time pass-by-reference has been removed in .../civicrm/CRM/Contribute/Form/Contribution/Main.php on line 1212

Is this related to PHP 5.4?
« Last Edit: October 28, 2012, 04:40:57 pm by Brylie Oxley »
Brylie Oxley
http://brylie.gnumedia.org

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: Call-time pass-by-reference removed Main.php line 1212
October 28, 2012, 04:52:06 pm

yes, its a 5.4 issue. Not sure why u r getting the below, maybe ensure u have E_DEPRECATED enabled in your php.ini (i thought we had done this automatically)

dont have a 5.4 install to test it against currently

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

Brylie Christopher Oxley

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 1
  • CiviCRM version: 4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: Fatal Error: Call-time pass-by-reference removed Main.php line 1212
October 28, 2012, 05:02:58 pm
OK, so we want PHP to show E_DEPRECATED errors, correct?

Also, this error is causing a 'white screen', or at least a screen with only an error on it. E.g. when we click 'test-drive page' on the contribution pages, the following page simply displays FATAL ERROR ...

I placed the following into a php.ini in my D7 root:
Code: [Select]
error_reporting = E_ALL & E_DEPRECATED & ~E_STRICT
I am not sure if the E_DEPRECATED is redundant.

The fatal error still occurs.
« Last Edit: October 28, 2012, 05:10:39 pm by Brylie Oxley »
Brylie Oxley
http://brylie.gnumedia.org

Brylie Christopher Oxley

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 1
  • CiviCRM version: 4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: Fatal Error: Call-time pass-by-reference removed Main.php line 1212
October 28, 2012, 06:20:07 pm
Should I file this on the issue tracker?
Brylie Oxley
http://brylie.gnumedia.org

sibro

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.27
  • MySQL version: 5.5
  • PHP version: 5.4
Re: Fatal Error: Call-time pass-by-reference removed Main.php line 1212
November 04, 2012, 06:07:22 am
Can't tell if I have the same problem. Displaying a contribution page I get a WSOD. Unfortunately I have tried to turn on all errors  but see nothing in any logs. A common thread is we are on PHP 5.4
Bruce

sibro

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.27
  • MySQL version: 5.5
  • PHP version: 5.4
Re: Fatal Error: Call-time pass-by-reference removed Main.php line 1212
November 04, 2012, 08:47:21 am
I was able to make the error show.
I am on Civicrm 4.2.4, The error moved  16 lines
Fatal error: Call-time pass-by-reference has been removed in /home/fjmcprod/public_html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php on line 1228

 while ($priceField->fetch()) {
1228         CRM_Price_BAO_FieldValue::getValues($priceField->id,&$values);
          if ($priceField->name == "membership_amount") {
            if ($priceFiledID = CRM_Utils_Array::value("price_{$priceField->id}", $params)) {
              $this->_params['selectMembership'] = $params['selectMembership'] = CRM_Utils_Array::value('membership_type_id', $values[$priceFiledID]);
              $this->set('selectMembership',CRM_Utils_Array::value('selectMembership', $params));
              if (CRM_Utils_Array::value('is_separate_payment', $this->_membershipBlock) == 0) {
                $this->_values['amount'] = CRM_Utils_Array::value('amount', $values[$priceFiledID]);

I am not strong in PHP: I need to get the contribution fixed to go live.

I found this item in the issue tracker as 10625
« Last Edit: November 04, 2012, 09:33:35 am by sibro »
Bruce

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: Call-time pass-by-reference removed Main.php line 1212
November 04, 2012, 09:27:32 am

you should change &$values to $values and see if it works

however, seems like there will be a few other issues with civi and php 5.4. we've not run civi with that php version a lot and i suspect there will be other issues with 5.4

we do hope that Civi v4.3 will work better with PHP v5.4

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

sibro

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.27
  • MySQL version: 5.5
  • PHP version: 5.4
Re: Fatal Error: Call-time pass-by-reference removed Main.php line 1212
November 04, 2012, 09:40:37 am
Removing the & resolved the problem

Thanks
Bruce

Brylie Christopher Oxley

  • I post occasionally
  • **
  • Posts: 52
  • Karma: 1
  • CiviCRM version: 4.x
  • CMS version: Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.x
Re: Fatal Error: Call-time pass-by-reference removed Main.php line 1212
November 04, 2012, 06:37:20 pm
Quote from: Donald Lobo on November 04, 2012, 09:27:32 am
you should change &$values to $values and see if it works

Yep! That worked. Thanks Lobo  :)

How can I help with the 5.4 testing process?
Brylie Oxley
http://brylie.gnumedia.org

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • (Resolved) Fatal Error: Call-time pass-by-reference removed Main.php line 1212

This forum was archived on 2017-11-26.