Undefined index: #format in Drupal\filter\Element\TextFormat::processFormat()

Created on 10 November 2022, over 2 years ago
Updated 7 September 2023, over 1 year ago

Problem/Motivation

Receive the following PHP notices:

Notice: Undefined index: #format in Drupal\filter\Element\TextFormat::processFormat() (line 195 of /var/www/web/core/modules/filter/src/Element/TextFormat.php)

Notice: Undefined index: #format in Drupal\filter\Element\TextFormat::processFormat() (line 217 of /var/www/web/core/modules/filter/src/Element/TextFormat.php)

Notice: Undefined index: #format in Drupal\filter\Element\TextFormat::processFormat() (line 218 of /var/www/web/core/modules/filter/src/Element/TextFormat.php)

Notice: Undefined index: #format in Drupal\filter\Element\TextFormat::processFormat() (line 219 of /var/www/web/core/modules/filter/src/Element/TextFormat.php)

πŸ› Bug report
Status

Closed: outdated

Version

9.5

Component
FilterΒ  β†’

Last updated 4 days ago

No maintainer
Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Since there hasn't been a follow up to #5/#6 going to close for now.

    If still a valid bug please reopen updating issue summary with steps.

    Thanks all!

  • πŸ‡ΊπŸ‡ΈUnited States esod

    I'm getting the same warnings on a webform that is placed in a webform block in a layout. Anonymous users don't have access to the Rich Text text format, and the webform is (or will be) available to anonymous users.

    My webform contains two processed_text elements with '#format': rich_text and one text_format element, with '#allowed_formats': rich_text: rich_text.

    Site specifications are:
    Drupal 9.5.10
    PHP 8.1
    webform 6.1.5

    Updating webform to 6.2.6-beta6 won't help since $element['#format'] is still written in core/modules/filter/src/Element/TextFormat.php, and $element['#format'] does not exist for anonymous users. If I add anonymous users to the Rich Text text format, the warnings go away, but doing so is not a possible solution.

    The warning is being thrown when I switch the theme to Olivero.

  • πŸ‡ΊπŸ‡ΈUnited States esod

    This patch may solve the problem. Submitted it for testing.

  • πŸ‡ΊπŸ‡ΈUnited States esod

    Missed one. Updated patch.

  • last update over 1 year ago
    30,341 pass
  • @esod opened merge request.
Production build 0.71.5 2024