- πΊπΈUnited States RichardDavies Portland, Oregon
@alfattal Did you ever figure out the cause or solution to the entity browser items no longer being clickable after upgrading lightning_media? I'm experiencing the exact same issue.
- πΊπΈUnited States alfattal Minnesota
@RichardDavies No, I did not and I'm still waiting for an update from the module maintainer (phenaproxima) after he requested attaching "pre-update" and "post-update" versions of my composer.lock file.
- πΊπΈUnited States RichardDavies Portland, Oregon
After digging into this a bit, I believe this commit in v4.7 is the culprit. It changed how JS/CSS gets applied to entity browsers. I've verified that after upgrading to 4.7 or above, my entity browser no longer has the JS/CSS that was formally applied to the entity browser and adds the "click" event handler.
I don't fully understand the rationale behind that change, but it seems to be intentionally more selective about when the JS/CSS gets applied... is there something different I need to do to my entity browser configuration so that it meets the more selective criteria now?
- πΊπΈUnited States phenaproxima Massachusetts
I don't fully understand the rationale behind that change, but it seems to be intentionally more selective about when the JS/CSS gets applied... is there something different I need to do to my entity browser configuration so that it meets the more selective criteria now?
Thanks for the great detective work, @RichardDavies! I would not have thought to look that far back, and it wasn't clear from the bug report that this was breaking for a different entity browser apart from the ones that were previously shipped with Lightning Media. (It was especially unclear because it has nothing to do with the change made in this issue.)
That CSS/JS library was custom-developed for the media_browser and ckeditor_media_browser entity browsers which shipped in older versions of Lightning Media. It was never intended to be used by other entity browsers.
With that in mind: in Lightning Media 8.x-4.0, we stopped shipping entity browsers. We continued to package the Entity Browser module, to avoid breaking sites which use it, but we no longer used Entity Browser ourselves. So, it made sense to apply that library more selectively to try and support sites that were still using the entity browsers that we shipped in Ye Olden Days. But, as I said, that library was never meant for other entity browsers that we didn't create, and in fact, I would consider it a bug that it was getting applied to other entity browsers.
If you need to restore the functionality, I'd say the proper solution is to implement the appropriate form_alter hook in your own custom module, and include the library there (
YOURMODULE_form_entity_browser_ENTITYBROWSERID_form_alter
). To future proof it even more, go ahead and copy the entire library, wholesale, into your custom module as well. :) Since we are not using it, I don't see any value in reverting the commit. (In fact I would like to deprecate the library as a whole and remove it in a future version of Lightning Media.)I'd consider this case closed, but feel free to reach out on Drupal Slack if you'd like to discuss more.