Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
a7fccaae
Commit
a7fccaae
authored
Apr 01, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2230055
by tim.plunkett: Views handlers should not be initialized during route building.
parent
a83352a1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
13 deletions
+1
-13
core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
.../lib/Drupal/views/Plugin/views/display/PathPluginBase.php
+1
-11
core/modules/views/tests/Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
.../Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
+0
-2
No files found.
core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
View file @
a7fccaae
...
...
@@ -139,10 +139,7 @@ protected function getRoute($view_id, $display_id) {
// page arguments so the argument actually comes through.
$arg_counter
=
0
;
$this
->
view
->
initHandlers
();
$view_arguments
=
(
array
)
$this
->
view
->
argument
;
$argument_ids
=
array_keys
(
$view_arguments
);
$argument_ids
=
array_keys
((
array
)
$this
->
getOption
(
'arguments'
));
$total_arguments
=
count
(
$argument_ids
);
$argument_map
=
array
();
...
...
@@ -247,10 +244,6 @@ public function alterRoutes(RouteCollection $collection) {
$route
=
$this
->
getRoute
(
$view_id
,
$display_id
);
$path
=
$route
->
getPath
();
// Load the argument IDs from the view executable.
$view_arguments
=
(
array
)
$this
->
view
->
argument
;
$argument_ids
=
array_keys
(
$view_arguments
);
// Replace the path with the original parameter names and add a mapping.
$argument_map
=
array
();
// We assume that the numeric ids of the parameters match the one from
...
...
@@ -281,9 +274,6 @@ public function executeHookMenuLinkDefaults(array &$existing_links) {
// views_arg_load -- which lives in views.module.
$bits
=
explode
(
'/'
,
$this
->
getOption
(
'path'
));
$page_arguments
=
array
(
$this
->
view
->
storage
->
id
(),
$this
->
display
[
'id'
]);
$this
->
view
->
initHandlers
();
$view_arguments
=
$this
->
view
->
argument
;
// Replace % with %views_arg for menu autoloading and add to the
// page arguments so the argument actually comes through.
...
...
core/modules/views/tests/Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
View file @
a7fccaae
...
...
@@ -188,8 +188,6 @@ public function testCollectRoutesWithNamedParameters() {
/** @var \Drupal\views\ViewExecutable|\PHPUnit_Framework_MockObject_MockObject $view */
list
(
$view
)
=
$this
->
setupViewExecutableAccessPlugin
();
$view
->
expects
(
$this
->
once
())
->
method
(
'initHandlers'
);
$view
->
argument
=
array
();
$view
->
argument
[
'nid'
]
=
$this
->
getMockBuilder
(
'Drupal\views\Plugin\views\argument\ArgumentPluginBase'
)
->
disableOriginalConstructor
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment