Media Library Ajax error when using pagination or search

Created on 31 July 2024, 5 months ago
Updated 5 August 2024, 5 months ago

Problem/Motivation

Our website has the media library module enabled. We are using media for all the files that can be attached to a node. When selecting a media from the media library, if the media item is found using the pagination or the search provided by the media library modal, it will fail and give an ajax error.

Steps to reproduce

  1. Open the media library
  2. Search for a media item using the pagination or/and the search bar
  3. Select and item and save
  4. A Drupal error message is shown on the screen and in the console

The error is a generic ajax error. It is thrown from this function:

 Drupal.Ajax.prototype.error = function(xmlhttprequest, uri, customMessage) {
        if (this.progress.element)
            $(this.progress.element).remove();
        if (this.progress.object)
            this.progress.object.stopMonitoring();
        $(this.wrapper).show();
        $(this.element).prop('disabled', false);
        if (this.$form && document.body.contains(this.$form.get(0))) {
            const settings = this.settings || drupalSettings;
            Drupal.attachBehaviors(this.$form.get(0), settings);
        }
        throw new Drupal.AjaxError(xmlhttprequest,uri,customMessage);
    }
🐛 Bug report
Status

Postponed: needs info

Version

10.3

Component
Media 

Last updated about 12 hours ago

Created by

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

Comments & Activities

Production build 0.71.5 2024