After recently updating from Drupal 9.5.11 to 10.1.5 we have spotted some issues with the results displayed in the media library widget.

Basically if I filter results, for example on the string "horris" then insert a new image with the string "horris" in the name, when I the filter on "horris" after the addition, the results are incorrectly returned, visually they look ok, but the numbering applied to the results is broken so for example I might on inspection of the HTML see 2 x 0 ID result entries (both results in the screen grabs have the same ID and value). This means that I can then select an image and get a different one inserted into the node field (in my screen grab scenario, selecting the "horris" image results in "horris 1" getting added to my underlying node's field.)

Clearing redis cache resolves the issue, until it happens again. I have for the time being disabled caching on the media library views which works-around the issue but i'd like to understand why this occurring now and wasn't an issue in Drupal 9. Thanks

enter image description here

enter image description here

enter image description here

  • This seems more of a bug report than a question of the sort that can get an answer here. In the first place I would try to reproduce the bug on a basic Drupal installation.
    – cilefen
    Oct 27 at 13:27
  • I've had something very similar on my project. I'm 99% sure the Media Library Widget is bugged when combined with Views exposed filters. I'm trying to create a reproducable bug report (I'm not using Redis on my site). I'm curently using the same workaround with disabled views caching.
    – Hudri
    Oct 27 at 18:01
  • @Hudri please post the bug report if you manage to reproduce
    – Mathew
    Oct 31 at 13:52
  • This is a reproducable bug, opened issue 3401815 on d.o
    – Hudri
    Nov 15 at 11:02
  • 1
    I’m voting to close this question because it is a bug which should be reported on the appropriate issue queue on drupal.org.
    – cilefen
    Nov 15 at 12:15


Browse other questions tagged or ask your own question.