mercury_editor_components_setup() throws an uncaught exception if the Page content type doesn't have a Body field

Created on 8 June 2023, about 1 year ago
Updated 31 October 2023, 8 months ago

Problem/Motivation

The second line of mercury_editor_components_setup() calls $body_field->delete(), but $body_field can be null if the field doesn't exist, in which case PHP throws an exception and the rest of the function doesn't run.

Steps to reproduce

  • Install Standard Profile.
  • Go to Manage Fields of the Page content type.
  • Delete the Body field (in my case, I had done this because I had already replaced this field with a regular Paragraphs field prior to installing Mercury Editor).
  • Install Mercury Scaffold module. During the installation of this module's dependencies, you get a "Website encountered an unexpected error" message.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States effulgentsia

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

Comments & Activities

Production build 0.69.0 2024