Preview link ajax error on adding new media in media library modal

Created on 11 August 2024, 4 months ago
Updated 12 September 2024, 3 months ago

Problem/Motivation

On adding new media from media library modal, preview link generates ajax error when clicked after choosing a focus point on image.
After investigations, the problem is located in focal_point.js:

// Update the ajax binding to reflect the new preview link href value.
    Drupal.ajax.instances.forEach(function (instance, index) {
      if (instance && $(instance.element).data("selector") === dataSelector) {
        const href = $(instance.selector).attr("href"); // Here instance.selector is always null.
        Drupal.ajax.instances[index].url = href;
        Drupal.ajax.instances[index].options.url = href;
      }
    });

Proposed resolution

Use the correct selector.

πŸ› Bug report
Status

Needs work

Version

2.1

Component

Media Integration

Created by

πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco

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

Comments & Activities

Production build 0.71.5 2024