0

We're running CiviCRM 5.66, WordPress 6.3.22, and PHP 8.1.

We had our hosting service (CiviHosting) upgrade us to CiviCRM 5.66.0 on Sunday. We last upgraded about a year ago. Yesterday (Wednesday) a user noticed our Membership sign-up page (a CiviCRM Contribution page) covered in what appeared to be error messages.

By way of example, here's a screen capture of the portion of the form asking for First Name;

screen cap

Transcription:

Warning: Undefined array key "options_per_line" in /home/antietam/www/dev/wp-content/uploads/civicrm/templates_c/en_US/%%5C/5C2/5C26BC2B%%Fields.tpl.php on line 65

First Name *

Warning: Undefined array key "is_datetime_field" in /home/antietam/www/dev/wp-content/uploads/civicrm/templates_c/en_US/%%5C/5C2/5C26BC2B%%Fields.tpl.php on line 110

Warning: Undefined array key "prefix" in /home/antietam/www/dev/wp-content/uploads/civicrm/templates_c/en_US/%%5C/5C2/5C26BC2B%%Fields.tpl.php on line 145

After a little research on similar reports on StackExchange, it's clear these are actually PHP Warnings and (probably) do not actually impact the function of the form.

I could not turn off the errors/warnings by setting error_reporting in the global php.ini file to "Off" but found that reverting PHP to version 7.4 did clear them from the form.

So now we're running PHP 7.4 on our production site, which seems low risk, but is not sustainable. I recognize we have only masked the problem, not solved it.

We do not have any other Contribution Pages active on the site at the moment, but will turn one on next week to gather registrations for our next Event. That form also is crawling with these warnings in our Development environment (PHP 8.1), but is clean in production (PHP 7.4).

I've left our Dev site at PHP 8.1 if you'd like to see the problem our user saw, here: https://dev.antietaminstitute.org/become-a-member/

My uneducated guess is that there is some code in CivCRM core having to do with Contribution Pages that is incompatible with PHP8, spawning these warnings.

I do not know enough about the CiviCRM core bug list, but hope this is already on it, or could be added if it is, in fact, a previously unreported bug.

I'd be very glad for any insight, recommendations, or other feedback, and happy to answer any questions.

Brian

2
  • Civi works just fine on PHP 8 - so while i don't know what might be triggering the warnings on your site, fundamentally civi is fine with php 8. Have you tried deleting your templates_c folder since it could be that there is some cached stuff in there referencing the older version
    – petednz - fuzion
    Oct 20, 2023 at 1:40
  • Thanks Petednz; I deleted the templates_c folder, but there was no change. Warnings still appear. Oct 21, 2023 at 14:10

1 Answer 1

2

Those warnings won't prevent anything from working properly with PHP 8.1, they're just warnings about how future versions of PHP will behave. See this previous question for settings to avoid having the warnings show up.

There are a lot of these warnings in PHP 8, but we're slowly cleaning them all up. You can join the effort if you want!

4
  • Thanks Lars. I've edited both the global and local php.ini files to set error_reporting=E_ALL & ~E_DEPRECATED & ~E_WARNING, but still have the warnings. There must be something else I'm missing, so I'll keep at it. Oct 21, 2023 at 14:27
  • You're in production mode and debugging is off?
    – Lars SG
    Oct 21, 2023 at 16:00
  • Yes - Environment set to Production, Enable Debugging selected No. Oct 22, 2023 at 14:40
  • You have error_reporting(E_ALL & ~E_DEPRECATED & ~E_WARNING); or error_reporting=E_ALL & ~E_DEPRECATED & ~E_WARNING? Those aren't the same.
    – Lars SG
    Oct 22, 2023 at 22:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.