AJAX error when trying to use with Media Library modal uploader

Created on 15 January 2025, 3 months ago

Problem/Motivation

I am getting an AJAX error that is preventing upload through the media library modal 'add or select media'

Steps to reproduce

  • Enable Media and Media Library
  • Add a media reference field to a content type using Image media type
  • create a new node, and select media
  • try to use the upload form within the 'add or select media' modal to upload a new image

The image fails to attach or upload, and the console reports the following error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /media-library?media_library_opener_id=media_library.opener.field_widget&media_library_allowed_types%5Bimage%5D=image&media_library_selected_type=image&media_library_remaining=1&media_library_opener_parameters%5Bfield_widget_id%5D=field_media_thumbnail_pdf&media_library_opener_parameters%5Bentity_type_id%5D=node&media_library_opener_parameters%5Bbundle%5D=resources&media_library_opener_parameters%5Bfield_name%5D=field_media_thumbnail_pdf&media_library_opener_parameters%5Bentity_id%5D=3381&media_library_opener_parameters%5Brevision_id%5D=11441&hash=gyfQi7DXqomP1GtjuyDL2sC1HlP14NHi3MpQmI5mXhA&ajax_form=1
StatusText: parsererror
ResponseText: Error: Cannot use object of type Drupal\file\Entity\File as array in Drupal\rich_image\Plugin\Field\FieldType\RichImageItem->setValue() (line 331 of /app/web/modules/contrib/rich_image/src/Plugin/Field/FieldType/RichImageItem.php).
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada peterhebert

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

Comments & Activities

Production build 0.71.5 2024