_editor_get_formatted_text_fields and fields hidden from the form mode

Created on 22 August 2024, 3 months ago
Updated 4 September 2024, 3 months ago

Problem/Motivation

I have some formatted text fields on a node type, but the fields are actually hidden from the form display. Due to how the code is currently written, it doesn't take that into account and a PHP warning is thrown:

Warning: foreach() argument must be of type array|object, null given in media_contextual_crop_embed_form_alter() (line 41 of modules/contrib/media_contextual_crop_embed/media_contextual_crop_embed.module).

Steps to reproduce

  1. Add a formatted text field to an entity
  2. Hide it on the form display
  3. Visit the edit page of the entity type

Proposed resolution

Check that the field is actually part of the form.

Remaining tasks

  • Resolve the PHP warning

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States devkinetic

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024