WorkspacesHtmlEntityFormController builds entity forms twice

Created on 17 April 2025, 14 days ago

Problem/Motivation

\Drupal\workspaces\Controller\WorkspacesHtmlEntityFormController::getContentResult() calls ::getFormObject() once at the beginning of the method to retrieve the entity from the form object, and again at the end through the call to ::getContentResult() on the inner service.

Steps to reproduce

- add a breakpoint in a hook_entity_create() implementation and load the entity add page for a workspace-supported entity type
- notice that the breakpoint gets hit twice

Proposed resolution

Retrieve the entity "manually" from the route match object.

Remaining tasks

Review.

User interface changes

Nope.

Introduced terminology

None.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

Nope.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

workspaces.module

Created by

πŸ‡·πŸ‡΄Romania amateescu

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