fix PHP 8.0 TypeError: array_merge(): Argument #2 must be of type array, null given

This commit is contained in:
Ralf Becker 2021-11-10 12:47:05 +01:00
parent 1ea91d8721
commit c1dfa685ec

View File

@ -405,7 +405,7 @@ class Customfields extends Transformer
$all_readonly = $this->is_readonly($cname, $form_name);
$value_in = self::get_array($content, $form_name);
// if we have no id / use self::GLOBAL_ID, we have to set $value_in in global namespace for regular widgets validation to find
if (!$this->id) $content = array_merge($content, $value_in);
if (!$this->id) $content = array_merge($content, (array)$value_in);
//error_log(__METHOD__."($cname, ...) form_name=$form_name, use-private={$this->attrs['use-private']}, value_in=".array2string($value_in));
if($this->getElementAttribute($form_name, 'customfields'))
{