Block settings configuration page needs subform state

Created on 18 July 2025, 15 days ago

Problem/Motivation

Since this issue was completed #2537732: PluginFormInterface must have access to the complete $form_state (introduce SubFormState for embedded forms) the core block form used the subform state for the settings. It seems that the block field widget also needs to have a subform state, so it doesn't assume that the settings form is the top level form.

Steps to reproduce

  1. Install Block field module.
  2. Add the block field type to any content type.
  3. Install AI module ( https://www.drupal.org/project/ai ) version 1.1.1 or higher.
  4. Install AI Chatbot module.
  5. Create chat assistant.
  6. Fill in the block field with the "AI DeepChat Chatbot" block.
  7. Save the content item.
  8. Try to edit content item.
  9. Try to edit the block settings.
  10. Observe fatal error:

Error: Call to undefined method Drupal\Core\Form\FormState::getCompleteFormState() in Drupal\ai_chatbot\Plugin\Block\DeepChatFormBlock->blockForm() (line 222 of /var/www/html/web/modules/contrib/ai/modules/ai_chatbot/src/Plugin/Block/DeepChatFormBlock.php).

Proposed resolution

Use subform state for the block settings embedded form, the same way the core is doing it.

Remaining tasks

Review MR

User interface changes

None

API changes

None

Data model changes

None

Possible related issue 🐛 Crash when adding block Site branding (system_branding_block) to the default value RTBC

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany a.dmitriiev

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