Impossible to override a media item on a node that is not saved yet

Created on 3 July 2025, 3 days ago

Problem/Motivation

When you are creating a node with a media with contextual modifications field, after filling out all the fields, adding all the media items, and you then want to directly override the chosen media items in the context of this content item you run into an error message("Oops, something went wrong. Check your browser's developer console for more details."):

[Error] AjaxError: 
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /node/add/playground?ajax_form=1&_wrapper_format=drupal_ajax
StatusText: parsererror
ResponseText: TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/repos/drupal/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 433 of /var/www/html/repos/drupal/core/lib/Drupal/Component/Utility/Html.php).
	(anonymous function) (ajax.js:1221)
	complete (ajax.js:610)
	(anonymous function) (jquery.form.js:301)
	c (jquery.min.js:2:23218)
	fireWith (jquery.min.js:2:23975)
	E (jquery.min.js:2:69916)
	(anonymous function) (jquery.min.js:2:72285)

Steps to reproduce

  • Create a node with a media with contextual modifications field
  • Enter title and add media item
  • Before you save the node try to override the media item in the context of this node.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

User interface

Created by

🇩🇪Germany rkoller Nürnberg, Germany

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024