IEF (inline entity form) simple widget not working

Created on 5 October 2021, over 2 years ago
Updated 18 May 2023, about 1 year ago

Problem/Motivation

It seems not possible to use the IEF simple widget when there is no annotation created for the external entity.
If there is no annotation node, opening the edit form of the external entity will result in an error:

Error: __clone method called on non-object in Drupal\external_entities\Form\ExternalEntityForm->form() (regel 36 van /app/web/modules/contrib/external_entities/src/Form/ExternalEntityForm.php) 

Steps to reproduce

- Create an content type for use as annotation
- Add that to the config of the external entity
- Add a simple IEF widget to the form display of the external entity
- Navigate to the edit form of the external entity

Proposed resolution

The error comes from the fact that there is no node to reference in the form. The code in this module just uses a clone on the return value of $external_entity->getAnnotation(), which could be NULL.

Just not cloining and setting the form value seems to work just fine, so what is that line of code supposed to do?

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands pgrond

Live updates comments and jobs are added and updated live.
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.69.0 2024