Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rift
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
rift
Commits
cc58eb9f
Commit
cc58eb9f
authored
2 months ago
by
Shibin Das
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3495133
by d34dman: Defer to combined_image_style if its available.
parent
ba84aca6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rift.services.yml
+2
-0
2 additions, 0 deletions
rift.services.yml
src/Routing/RouteSubscriber.php
+9
-3
9 additions, 3 deletions
src/Routing/RouteSubscriber.php
with
11 additions
and
3 deletions
rift.services.yml
+
2
−
0
View file @
cc58eb9f
...
...
@@ -46,6 +46,8 @@ services:
rift.route_subscriber
:
class
:
Drupal\rift\Routing\RouteSubscriber
arguments
:
-
'
@module_handler'
tags
:
-
{
name
:
event_subscriber
}
...
...
This diff is collapsed.
Click to expand it.
src/Routing/RouteSubscriber.php
+
9
−
3
View file @
cc58eb9f
...
...
@@ -2,18 +2,26 @@
namespace
Drupal\rift\Routing
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\Routing\RouteSubscriberBase
;
use
Drupal\Core\Routing\RoutingEvents
;
use
Symfony\Component\Routing\RouteCollection
;
class
RouteSubscriber
extends
RouteSubscriberBase
{
public
function
__construct
(
private
ModuleHandlerInterface
$moduleHandler
)
{}
/**
* {@inheritdoc}
*/
protected
function
alterRoutes
(
RouteCollection
$collection
):
void
{
/** @var \Symfony\Component\Routing\Route $route */
if
(
$route
=
$collection
->
get
(
'image.style_public'
))
{
if
(
$this
->
moduleHandler
->
moduleExists
(
'combined_image_style'
))
{
return
;
}
$path
=
$route
->
getPath
();
$route
->
setPath
(
str_replace
(
'image_style'
,
'image_styles'
,
$path
));
...
...
@@ -26,9 +34,7 @@ class RouteSubscriber extends RouteSubscriberBase {
*/
public
static
function
getSubscribedEvents
():
array
{
$events
=
[];
if
(
!
\Drupal
::
moduleHandler
()
->
moduleExists
(
'combined_image_styles'
))
{
$events
[
RoutingEvents
::
ALTER
]
=
[
'onAlterRoutes'
,
-
1025
];
}
$events
[
RoutingEvents
::
ALTER
]
=
[
'onAlterRoutes'
,
-
1024
];
return
$events
;
}
...
...
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