Problem/Motivation
At some point after upgrading to Drupal 10 the selection stopped working. The File upload widget works okay but the View display for selection just refreshes and does not submit any selections.
Steps to reproduce
Install module on Drupal 10 and install the example modules. Set a image field to use the file selection modal. Observe that node edit/add forms are not able to select an item.
I'm not seeing any JS or PHP errors thrown so it's really confusing. All I can tell is that the View is submitting and refreshing via AJAX. The exposed filters don't seem to be working either to look up the name.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | entity_browser_widgets.png | 358.83 KB | diego sabolo |
| #16 | media.mov | 9.03 MB | shelane |
| #16 | field-form-settings.png | 24.57 KB | shelane |
Comments
Comment #2
joseph.olstadThis is a duplicate of:
#2998066: Field widget for the Media library is not compatible with inline form errors
A fix is available and it does work, I have tested the fix.
If you inspect your console, you'll see a related javascript exception.
Comment #3
joseph.olstadhttps://www.drupal.org/files/issues/2019-08-15/2998066-disable-inline-fo...
Comment #4
joseph.olstadseems to me related as I mentioned, please review the linked patch
https://www.drupal.org/files/issues/2019-08-15/2998066-disable-inline-fo...
Comment #5
joseph.olstadHere's the two patches I'm using with D10, php 8.1
If you want to use PHP 8.2, you'll need more patches for entity_browser
Comment #6
nsciacca@joseph.olstad Thanks for the reply but what's interesting is that I don't have Inline Form Errors enabled. There are no javascript errors thrown and nothing on the PHP side in the watchdog logs. Here's a video of me trying to select something:
https://www.dropbox.com/scl/fi/zr0lhshhkzl4cunjuf2lm/Entity-Browser-AJAX...
I guess there could be something else in our custom code that could be conflicting so I will try to spin up a vanilla Drupal with similar config to see if I can replicate it there.
Comment #7
nsciaccaOkay I found that it is a conflict with a patch I have for Drupal core:
"2858890 - Drupal.views.ajaxView is not initializing pagers in nested views": "private/patches/2858890-core-views-ajax-nested-pagers.patch",
We can close and I'll investigate whether those are needed anymore
Comment #8
robbdavis commentedI am also seeing this issue. The above patches don't help. No errors in the console.
Comment #9
nsciacca@robbdavis - If you've previously patched core for the same issue I have noted above, try the patch from the MR over on https://www.drupal.org/project/drupal/issues/2858890#comment-15337125
I ended up making some adjustments there and it helped.
https://git.drupalcode.org/project/drupal/-/merge_requests/4242/diffs.patch
Comment #10
shani mauryaNone of the above solutions has worked on my side. I have Drupal 10.1.6 and PHP 8.1. Nothing in the console and php log.
Comment #11
shani mauryaComment #12
tcmktg commentedNo patches that actually work yet. Using 10.1.7 and Php 8.1.
Comment #13
joseph.olstadsee #2998066: Field widget for the Media library is not compatible with inline form errors
composer require 'drupal/entity_browser:2.x-dev@dev'Comment #14
shelaneI still have this issue with the 2.10 version that was just released that includes the inline form errors fix. So, that is not related to this problem. I click on images to be able to select, but nothing happens. No errors are reported in the inspector console or in the watchdog log. This is on both a php 8.1 and php 8.2 with Drupal 10.1.7.
Comment #15
simon2d commentedHi all,
Just confirming I'm experiencing the same issue as everyone else is mentioning
We have a custom block with field that is an entity reference media type. When adding a new image, we can only select the image via the checkbox and click insert. But clicking insert swirls for a few seconds and then doesn't attach the image on the page.
This has occurred for us when switching from 10.0.11 to 10.1.0 (or higher, have tested 10.1.6 as well)
Using the dev version, or the patches above has not fixed the issue
Regards
S
Comment #16
shelaneI still don't see errors, but I did a screen shot of my settings and a screen recording of the action. Also, in this recording, I demonstrate a work around. It's hard to see in the first part that I am trying to click on the images and nothing happens. I click over to the Upload tab and then click back to the Library tab and it starts working.
Comment #17
simon2d commentedHi all, is there any update on this issue? We are still experiencing it on 10.1.x
Comment #18
diego sabolo commentedI hope this can help, In my case, I've experienced that issue after upgrading to 10.x and I've fixed it with a configuration change.
Go to the entity browser configuration page (admin/config/content/entity_browser), select the entity browser you are using in your field, got to the Widgets Settings tabs. ensure you use the default media browser widget provided by the module and not a plugging from a third-party contributor (In my case lightning media)
See attached screenshot:

Comment #19
lisagodareThanks to the clue about Lightning Media, I was able to hunt down my issue and fix it.
Specifically, using Media: Image Browser, if the Image field in question allowed more than one reference, I would not be able to select images in the entity browser. @shelane's workaround did work though.
Patch over there fixes it for me:
https://www.drupal.org/project/lightning_media/issues/3392244#comment-15...
Comment #20
anybody