i am in the midst of fixing our website (which is built using Drupal version 7.67) that shows many errors after the PHP version is updated into PHP 8.0.

One of the errors that i am stuck now is this particular error

Exception: Serialization of 'Closure' is not allowed in serialize();

After i did some traces, it appears that this is happening when drupal_get_form or drupal_build_form is getting called.

Does anyone knows where should I look in the code to find out why is this happening?

1 Answer 1

  1. Drupal version 7.67 was released on 8 May 2019. Therefore, your Drupal site is not secured as the latest version as of this writing is 7.93 which was released on 7 December 2022.

  2. PHP 8 support was introduced in version 7.79 as per PHP requirements docs.

Thus, you will need to revert back to your previous PHP 7 version and upgrade Drupal to the latest version and then upgrade your PHP to version 8.

  • Thanks for the info, however we have reasons why we cannot upgrade the Drupal version. That is why we were deployed to fix the incompatibilities issues and make do with the current Drupal version whilst using PHP 8.0 environment.
    – Frans
    Dec 13, 2022 at 4:00
  • 3
    @Frans there can't be any good reason. Since your Drupal version is 2+ years old, it has security holes that have been patched since. Having a Drupal site that can't be upgraded to the next minor version is simply unacceptable due to security. You're much better off finding a fix for those reasons rather than fixing the PHP incompatibilities by hand.
    – No Sssweat
    Dec 13, 2022 at 4:56
  • Noted with thanks for the input. I will see if i can convince the managements about it.
    – Frans
    Dec 13, 2022 at 5:41

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.