Fix 'base_form_id' warning on custom fields in layout paragraphs

Created on 23 August 2024, 3 months ago
Updated 26 August 2024, 3 months ago

Problem/Motivation

Getting the following warning when trying to add a new paragraph with a custom field through layout paragraphs, specifically with mercury editor. β†’

Warning: Undefined array key "base_form_id" in Drupal\custom_field\Plugin\CustomFieldWidgetBase->widget() (line 76 of /var/www/html/docroot/modules/contrib/custom_field/src/Plugin/CustomFieldWidgetBase.php).

Steps to reproduce

  1. Create a new paragraph with a custom field
  2. Allow that paragraph to be used on a page with a layout paragraph field
  3. Turn mercury editor on for that content type
  4. Click to add a new paragraph and select your newly created paragraph type with the custom field
  5. But don't actually add the paragraph or fill in any data into the custom field
  6. close out of the 'Add new paragraph' dialogue
  7. Open up the 'add new paragraph dialogue again and you will see numerous instances of the warning above.

Proposed resolution

On the relevant line listed in the warning, simply check for the 'base_form_id' array key in the line that defined the required status of the form widget.

Apply the patch provided in this issue.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States devanbicher

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

Comments & Activities

Production build 0.71.5 2024