Problem/Motivation
I'm not sure if this is a known bug since some time or not, but it seems that by adding any additional Contextual Filter to the "Media Library" widgets (Grid and Table), then the Table mode breaks and you can no longer insert a selected image if you use a frontend theme for your node content form.
Steps to reproduce the issue
- Install Drupal (e.g. with: drush si -y demo_umami --sites-subdir default --account-name admin --account-pass admin )* so that you end up with the default "Media Library" view from say the Demo Umami profile
- Edit the "Media Libary" view: Widget and Widget (table) displays
- Add a contextual filter to both displays
- Allow node creation for authenticated users without giving them access to the backend theme, or unset "force backend theme" for node creation/edit in Theme Appearance settings
- Login as an authenticated user (i.e. not admin user account)
- Go to add media via the media library popup, select "Table" and try to select a media item from the library then "insert selected"
- Nothing should happen, it should stay on the media popup, and an Drupal.Ajax error should appear in console
- There are no log errors... this makes it hard to debug.
* You can skip the install if you have a working Drupal site, as long as you have the default "Media Library" view.