Handle forms without base form ID

Created on 7 July 2022, over 2 years ago
Updated 24 July 2023, over 1 year ago

Problem/Motivation

Some forms do not have a base form ID. In this case, FormBaseAlterEvent::getBaseFormId() raises a type error because it would return NULL.

Since the refactoring in #3277301: Adapt to centralised hook dispatcher in Drupal 9.4 , it seems like we need some way for events to state they should not dispatch.

Steps to reproduce

Attempt to render a form with no base form (it does not extend an existing form.)

Proposed resolution

Provide a method for events to short-circuit dispatching in ::getDispatcherType().

Remaining tasks

Review, tests?

User interface changes

None

API changes

Some return types are now nullable.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

🇺🇸United States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.71.5 2024