Problem/Motivation

On PHP 8.5 deprecation warning is triggered in Drupal\webform\Element\WebformHtmlEditor

Deprecated function: Using null as an array offset is deprecated, use an empty string instead in Drupal\webform\Element\WebformHtmlEditor::processTextFormat() (line 304 of /var/www/html/web/modules/contrib/webform/src/Element/WebformHtmlEditor.php).

$element['format']['format']['#default_value'] could have a NULL value.
Using NULL as an array offset is deprecated in newer PHP versions.

Proposed resolution

Add condition isset( $element['format']['format']['#default_value']) on line 304

Issue fork webform-3619716

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

yaqbick created an issue. See original summary.

yaqbick’s picture

Issue summary: View changes

alorenc’s picture

In my case, the field's stored filter format wasn't included in its #allowed_formats list, so TextFormat::processFormat() in core deliberately sets #default_value to NULL to force an admin to select a valid format.

The patch adds an isset($element['format']['format']['#default_value']) guard.

alorenc’s picture

Assigned: yaqbick » Unassigned
Status: Active » Reviewed & tested by the community

liam morland made their first commit to this issue’s fork.

liam morland’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Related issues: +#3590360: Make tests pass on PHP 8.5

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.