Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
orejime
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
orejime
Commits
f30fd25a
Commit
f30fd25a
authored
10 months ago
by
Linh Nguyen Manh
Committed by
Fabien Gutknecht
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3474819
: Drupal 11 Compatibility
parent
c69b3e28
Branches
Branches containing commit
Tags
2.0.11
Tags containing commit
1 merge request
!8
Issue #3474819: Drupal 11 Compatibility
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
orejime.info.yml
+1
-1
1 addition, 1 deletion
orejime.info.yml
src/Services/JsCollectionRendererOrejime.php
+5
-6
5 additions, 6 deletions
src/Services/JsCollectionRendererOrejime.php
with
6 additions
and
7 deletions
orejime.info.yml
+
1
−
1
View file @
f30fd25a
name
:
'
Orejime'
type
:
module
description
:
'
Drupal
integration
of
Orejime'
core_version_requirement
:
^9.2 ||
^10 || ^11
core_version_requirement
:
^10 || ^11
package
:
'
orejime'
configure
:
orejime_service.settings
dependencies
:
...
...
This diff is collapsed.
Click to expand it.
src/Services/JsCollectionRendererOrejime.php
+
5
−
6
View file @
f30fd25a
...
...
@@ -25,9 +25,9 @@ class JsCollectionRendererOrejime extends JsCollectionRenderer {
// A dummy query-string is added to filenames, to gain control over
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
// URL changed. Files that should not be cached get
REQUEST_TIME
as
// URL changed. Files that should not be cached get
the request time
as
a
// query-string instead, to enforce reload on every page request.
$default_query_string
=
$this
->
state
->
get
(
'system.css_js_q
uery
_s
tring
'
)
?:
'0'
;
$default_query_string
=
$this
->
assetQ
uery
S
tring
->
get
()
;
// Defaults for each SCRIPT element.
$element_defaults
=
[
...
...
@@ -38,7 +38,6 @@ class JsCollectionRendererOrejime extends JsCollectionRenderer {
// Loop through all JS assets.
foreach
(
$js_assets
as
$js_asset
)
{
// Element properties that do not depend on JS asset type.
$element
=
$element_defaults
;
$element
[
'#browsers'
]
=
$js_asset
[
'browsers'
]
??
[];
...
...
@@ -56,12 +55,12 @@ class JsCollectionRendererOrejime extends JsCollectionRenderer {
case
'file'
:
$query_string
=
$js_asset
[
'version'
]
==
-
1
?
$default_query_string
:
'v='
.
$js_asset
[
'version'
];
$query_string_separator
=
(
str
po
s
(
$js_asset
[
'data'
],
'?'
)
!==
FALSE
)
?
'&'
:
'?'
;
$element
[
'#attributes'
][
'src'
]
=
\Drupal
::
service
(
'file_url_g
enerator
'
)
->
generateString
(
$js_asset
[
'data'
]);
$query_string_separator
=
str
_contain
s
(
$js_asset
[
'data'
],
'?'
)
?
'&'
:
'?'
;
$element
[
'#attributes'
][
'src'
]
=
$this
->
fileUrlG
enerator
->
generateString
(
$js_asset
[
'data'
]);
// Only add the cache-busting query string if this isn't an aggregate
// file.
if
(
!
isset
(
$js_asset
[
'preprocessed'
]))
{
$element
[
'#attributes'
][
'src'
]
.
=
$query_string_separator
.
(
$js_asset
[
'cache'
]
?
$query_string
:
\Drupal
::
time
()
->
getRequestTime
());
$element
[
'#attributes'
][
'src'
]
.
=
$query_string_separator
.
(
$js_asset
[
'cache'
]
?
$query_string
:
$this
->
time
->
getRequestTime
());
}
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment