• WordPress v5.6.1
  • CiviCRM 5.34.0
  • php 7.3
  • No custom extensions that affect contributions except CiviDiscount.

When I try to add a new contribution or view contributions, I get an error and the log files have the following:

PHP Fatal error:  Only variables can be passed by reference in /home/xxx/www/www/wp-content/plugins/civicrm/civicrm/api/v3/Contribution.php on line 684
PHP Warning:  Declaration of CRM_Contribute_BAO_Contribution::getExportableFieldsWithPseudoConstants() should be compatible with CRM_Core_DAO::getExportableFieldsWithPseudoConstants($baoClass) in /home/xxx/www/www/civicrm_custom/php/CRM/Contribute/BAO/Contribution.php on line 33

It's also affecting groups so they won't load the contacts but I can view the group settings/Manage groups page.

If I disable the CiviContribute component, it all works fine.

Under the WordPress Site Health page, there are some php warnings but I don't know enough to know whether any of these would affect CiviCRM, e.g.

An active PHP session was detected
A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

The REST API encountered an error
The REST API request failed due to an error. Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)

Your site could not complete a loopback request
The loopback request to your site failed, this means features relying on them are not currently working as expected. Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)

I did try the site with php7.4 but that made no difference. From the error log, it looks like this has been happening since I upgraded the site to 5.33.2 in January. I ran another update today to 5.34.0 but that's not made a difference.

Any ideas would be gratefully received!

  • Immediately below the error in the CiviCRM logs there should be a "backtrace" - it will have the same timestamp. Could you please edit your question to include every line in the backtrace (that is, everything up to the next timestamped entry)? This will help people understand if an extension is causing this, etc. Feb 14, 2021 at 18:52
  • @JonG-MegaphoneTech Just checked and there's no backtrace recorded when I enable Contributions or when I try to open a page that triggers the error (e.g. Contributions > New Contribution). Only errors are recorded in the WordPress logs Feb 14, 2021 at 21:41


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.