AJAX error within WYSIWYG editor media button

Created on 19 September 2023, about 1 year ago
Updated 10 September 2024, 2 months ago

Problem/Motivation

When clicking the media button in the WYSIWYG editor, no modal opens, and I see the following AJAX error in the console.

An AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /media-library?media_library_opener_id=media_library.opener.editor&media_library_allowed_types%5B0%5D=image&media_library_selected_type=image&media_library_remaining=1&media_library_opener_parameters%5Bfilter_format_id%5D=full_html&hash=pv3J4eX9Dh0lbP0Q20th1xWnwM1djZHzpz5fYLi8yug\nStatusText: parsererror\nResponseText: Warning: Undefined array key \"no_edit_on_create\" in /app/web/modules/contrib/media_library_media_modify/media_library_media_modify.module on line 73

I'm only able to encounter this error on my local environment, so I'm mainly looking for assistance on tracking down why this error occurs.

I'm able to patch it out by changing the aforementioned line to the following:

  if (isset($media_library_state->getOpenerParameters()['no_edit_on_create'])) {

Adding the isset() wrapper around the function call.

What could cause that parameter to fail to return in getOpenerParameters?

Steps to reproduce

Click media button in WYSIWYG editor.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nessthehero

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