- Issue created by @alena_stanul
- last update
over 1 year ago run-tests.sh fatal error - @alena_stanul opened merge request.
- Status changed to Needs review
over 1 year ago 12:20pm 11 August 2023
In PHP 8.1 I catched PHP warning:
Deprecated function: unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in Bean->setFields() (line 235 of .../modules/contrib/bean/includes/bean.core.inc).
1) Go to 'block/add' page.
2) Add any block.
Add condition in the case when $this->data = null for the code in setFields() method for Bean class:
$values = is_array($this->data) ? $this->data : unserialize($this->data);
For example:
$values = is_array($this->data) || is_null($this->data) ? $this->data : unserialize($this->data);
or
$values = !is_string($this->data) ? $this->data : unserialize($this->data);
Needs review
1.0
Code
The issue particularly affects sites running on PHP version 8.1.0 or later.