hook_entity_prepare_form is called with the wrong arguments

Created on 8 December 2023, 7 months ago
Updated 10 December 2023, 7 months ago

Problem/Motivation

code>$this->prepareInvokeAll($entity, 'entity_prepare_form', $form_state); in EntityInlineForm::entityForm call is inconsistent: $entity is the child entity but $form_state->getFormObject() is the parent form object. The hook documentation says "Acts on an entity object about to be shown on an entity form" but the form state does not belong to this entity.

This easily leads to fatal errors as a node form will get a paragraph set on it. I strongly suspect https://www.drupal.org/project/inline_entity_form/issues/3396757 πŸ› Inline editing is broken on content that have workflows enabled Needs work is due to this, for example.

Steps to reproduce

None required. This is simply so.

Proposed resolution

I don't have the slightest idea. But I will work on this the next few hours.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada Charlie ChX Negyesi 🍁Canada

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

Comments & Activities

Production build 0.69.0 2024