OpenAI Content breaks node type edit form

Created on 2 June 2023, almost 2 years ago

Problem/Motivation

Enabling the OpenAI Content module breaks the node type edit form due to a type error.

Steps to reproduce

1. Enable OpenAI Content module
2. Go to the edit form for a content type e.g. /admin/structure/types/manage/article
3. See the page fail with the following error:

Uncaught PHP Exception TypeError: "_get_all_text_with_summary_fields(): Argument #1 ($entity) must be of type Drupal\\Core\\Entity\\ContentEntityInterface, Drupal\\node\\Entity\\NodeType given, called in /app/web/modules/contrib/openai/modules/openai_content/openai_content.module on line 26" at /app/web/modules/contrib/openai/modules/openai_content/openai_content.module line 180, referer: https://drupal-ai.lndo.site/admin/structure/types/manage/page/fields

Proposed resolution

As I see it the problem occurs because we try to edit a form unintentionally.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡°Denmark kasperg

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

Comments & Activities

Production build 0.71.5 2024