Update AiAgentForm to avoid "null" strings in exported agent config

Created on 1 April 2025, 1 day ago

Problem/Motivation

The AiAgentForm uses Yaml::dump(Yaml::parse(…)) to ensure the default value for default_information_tools is correctly indented. However, when there is no value (e.g. on the Add Agent form) becomes the string "null" which is displayed in the text box and upon form submission is saved to the Yaml as:

default_information_tools: 'null'

which means the value is saved as the string "null"

Steps to reproduce

View the Add Agent form at admin/structure/ai_agent/add

Proposed resolution

Only use Yaml::dump(Yaml::parse(…)) if there is a value, otherwise default to NULL.

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇬🇧United Kingdom justanothermark

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