Problem/Motivation
The version: VERSION lines in libraries.yml are creating a version query string using the Drupal Core version number for the asset files, making these files cached in the browser dependent on the Core version.
Steps to reproduce
This can produce various problems after an update, as the old versions of assets might be loaded for users who have those cached. I discovered this issue when some functionality stopped working after 2.6 -> 2.8 update of the module. The issues were already reported here.
After some debugging, I found that the issues are fixed after I made sure the browser cache is cleared and the latest assets are loaded.
There could be other reported issues related to this.
Proposed resolution
Remove the version: VERSION lines from libraries.yml.
By doing this, Drupal will use an automatically generated query string added to filenames. From the code documentation:
The string changes on every update or full cache flush, forcing browsers to load a new copy of the files as the URL changed.
See: web/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php:62
The other option is to explicitly set the module's version on these lines and keep track of it when the version number changes/the asset is updated.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3325948-remove-library-version.patch | 1.87 KB | dave reid |
| #4 | remove_version_from_libraries-3325948-4.patch | 1.86 KB | keszthelyi |
Issue fork entity_browser-3325948
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
himanshu_jhaloya commentedhttps://www.drupal.org/project/field_group/issues/3163971 Related Remove VERSION from libraries.yml
Comment #3
himanshu_jhaloya commentedComment #4
keszthelyi commentedPatch from commit 582fe683
Comment #5
kthullSo glad I tried the patch in #4 since I was just getting never-ending throbber with no errors, making troubleshooting tricky.
Confirming this fixes my issue with v2.8
Comment #6
drupalgreenhorn commentedkeszthelyi
I tested the patch 4, it didn't fix the issue
so at this moment, with
Drupal core 9.5.3
we still have same issue with
entity_browser 8.x-2.9 (security update)
we still have to use entity_browser 8.x-2.6 so general user can create a new app with Entity Browser
Did you upgraded to Drupal core 9.5.3 and entity_browser 8.x-2.9 successfully?
Thank you
Comment #7
dave reidUpdated patch against current 8.x-2.x.
Comment #10
dave reidCommitted to 8.x-2.x.