Paragraphs form alter requires paragraph types to be set, but perhaps shouldn't?

Created on 20 October 2023, about 1 year ago
Updated 3 April 2024, 8 months ago

Problem/Motivation

Its handy for organising code to be able to have a Plugin for Form Altering all Paragraphs, and then specific Plugins for Form Altering specific paragraphs. For example we have a project that has a public, teaser, and restricted mode for all components extending access control. We want to apply form alters to all paragraphs to control all at once. Adding new paragraphs means having to modify the annotation; one more thing to forget.

Steps to reproduce

Leave off the 'paragraph_type', eg

 * @ParagraphsFormAlter(
 *   id = "my_module_paragraphs_form_alter",
 *   label = @Translation("Altering paragraphs form."),
 * )

and the form alters no longer kick in

Proposed resolution

Allow for the above annotation.

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom scott_euser

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

Comments & Activities

Production build 0.71.5 2024