Undefined array key \"#type\"

Created on 5 February 2025, 2 months ago

Problem/Motivation

Selecting a model template when i create a chat model in the azure providor i get an error message "Oops, something went wrong. Check your browser's developer console for more details."
In the console i see that a parseerror on the call to path "/admin/config/ai/providers/chat/azure?destination=/admin/config/ai/providers/azure" with this as warning :
"Warning: Undefined array key \"#type\" in /var/www/html/web/modules/contrib/ai/src/OperationType/GenericType/AbstractModelFormBase.php on line 112"

Steps to reproduce

Selecting a model template when i create a chat model in the azure providor.

But i enabled the azure provider module on another website, and this problem doesn't appear there.
So maybe there is a misconfiguration on this website ? I've already uninstalled, removed and installed this azure provider module. But that didn't solve the problem.

Proposed resolution

When is add an extra statement on line 112, the problem is gone.
So change this : if (is_array($element) && $element['#type'] === 'checkbox') {
to this : if (is_array($element) && isset($element['#type']) && $element['#type'] === 'checkbox') {

But i don't know if this is a good solution, because this is a change in the ai-module and not in this azure provider module.
Or can i do something else to resolve this problem ?

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium pbosmans

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

Comments & Activities

Production build 0.71.5 2024