Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Commits
0db6843c
Commit
0db6843c
authored
Apr 28, 2017
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2847657
by jibran, xjm: ViewsBlockBase doesn't expose parent view and display info
parent
f6fa46e5
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php
+14
-0
14 additions, 0 deletions
...odules/views/src/Plugin/Block/ViewsExposedFilterBlock.php
with
14 additions
and
0 deletions
core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php
+
14
−
0
View file @
0db6843c
...
@@ -24,9 +24,23 @@ public function getCacheContexts() {
...
@@ -24,9 +24,23 @@ public function getCacheContexts() {
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*
* @return array
* A renderable array representing the content of the block with additional
* context of current view and display ID.
*/
*/
public
function
build
()
{
public
function
build
()
{
$output
=
$this
->
view
->
display_handler
->
viewExposedFormBlocks
();
$output
=
$this
->
view
->
display_handler
->
viewExposedFormBlocks
();
// Provide the context for block build and block view alter hooks.
// \Drupal\views\Plugin\Block\ViewsBlock::build() adds the same context in
// \Drupal\views\ViewExecutable::buildRenderable() using
// \Drupal\views\Plugin\views\display\DisplayPluginBase::buildRenderable().
if
(
is_array
(
$output
)
&&
!
empty
(
$output
))
{
$output
+=
[
'#view'
=>
$this
->
view
,
'#display_id'
=>
$this
->
displayID
,
];
}
// Before returning the block output, convert it to a renderable array with
// Before returning the block output, convert it to a renderable array with
// contextual links.
// contextual links.
...
...
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