"Automatic conversion of false to array" deprecation when creating or editing content with PHP 8.1

Created on 25 November 2023, about 1 year ago

Problem/Motivation

The following deprecation is observed when creating, editing or even just visiting the Edit tab of a piece of content when running PHP 8.1:

Deprecated function: Automatic conversion of false to array is deprecated in form_builder() (line 1908 of [mysite]/includes/form.inc).

Steps to reproduce

Visit the Edit tab of a content node;
Check the log.

Proposed resolution

The source of this deprecation has been traced to line 32 of save_draft.module:

    $form['options']['status'] = false;

Changing this to:

    $form['options']['status'] = array();

fixed this for me.

Remaining tasks

Create a patch, test and commit. (Creating a patch is not something I know how to do I'm afraid.)

User interface changes

None

API changes

None

Data model changes

None

🐛 Bug report
Status

Needs work

Version

1.4

Component

Code

Created by

🇬🇧United Kingdom stevewilson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024