Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
facets
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
198
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
facets
Commits
4ebbe259
Commit
4ebbe259
authored
1 year ago
by
Pedro Cambra
Committed by
Markus Kalkbrenner
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3390365
: Avoid instanciating url_generator service in a foreach
parent
bbf60c4f
No related branches found
Branches containing commit
Tags
8.x-2.3
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/facets_range_widget/src/Plugin/facets/processor/RangeSliderProcessor.php
+4
-1
4 additions, 1 deletion
...dget/src/Plugin/facets/processor/RangeSliderProcessor.php
with
4 additions
and
1 deletion
modules/facets_range_widget/src/Plugin/facets/processor/RangeSliderProcessor.php
+
4
−
1
View file @
4ebbe259
...
...
@@ -52,13 +52,16 @@ class RangeSliderProcessor extends SliderProcessor implements PreQueryProcessorI
unset
(
$active_filters
[
''
]);
}
/** @var \Drupal\facets\Utility\FacetsUrlGenerator $url_generator */
$url_generator
=
\Drupal
::
service
(
'facets.utility.url_generator'
);
/** @var \Drupal\facets\Result\ResultInterface[] $results */
foreach
(
$results
as
&
$result
)
{
$new_active_filters
=
$active_filters
;
unset
(
$new_active_filters
[
$facet
->
id
()]);
// Add one generic query filter with the min and max placeholder.
$new_active_filters
[
$facet
->
id
()][]
=
'(min:__range_slider_min__,max:__range_slider_max__)'
;
$url
=
\Drupal
::
service
(
'facets.utility.
url_generator
'
)
->
getUrl
(
$new_active_filters
,
FALSE
);
$url
=
$
url_generator
->
getUrl
(
$new_active_filters
,
FALSE
);
$result
->
setUrl
(
$url
);
}
...
...
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