Score:-2

Serialization of 'Closure' is not allowed in serialize()

bf flag

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?

Score:4
ua flag
  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.

Frans avatar
bf flag
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.
No Sssweat avatar
ua flag
@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.
Frans avatar
bf flag
Noted with thanks for the input. I will see if i can convince the managements about it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.