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
302
Merge Requests
302
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
b4c0a16a
Commit
b4c0a16a
authored
Dec 02, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2345343
by damiankloip, dawehner, olli, Bès: view TITLE appears all the time
parent
d07e48a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
core/modules/views/src/Tests/Plugin/DisplayPageWebTest.php
core/modules/views/src/Tests/Plugin/DisplayPageWebTest.php
+14
-1
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display.yml
...s_test_config/test_views/views.view.test_page_display.yml
+1
-0
core/modules/views/views.theme.inc
core/modules/views/views.theme.inc
+5
-0
No files found.
core/modules/views/src/Tests/Plugin/DisplayPageWebTest.php
View file @
b4c0a16a
...
...
@@ -7,6 +7,8 @@
namespace
Drupal\views\Tests\Plugin
;
use
Drupal\views\Views
;
/**
* Tests the views page display plugin as webtest.
*
...
...
@@ -19,7 +21,7 @@ class DisplayPageWebTest extends PluginTestBase {
*
* @var array
*/
public
static
$testViews
=
array
(
'test_page_display_arguments'
,
'test_page_display_menu'
);
public
static
$testViews
=
array
(
'test_page_display
'
,
'test_page_display
_arguments'
,
'test_page_display_menu'
);
/**
* Modules to enable.
...
...
@@ -121,4 +123,15 @@ public function testPageDisplayMenu() {
$this
->
assertEqual
((
string
)
$menu_link
[
0
],
'New title'
);
}
/**
* Tests the title is not displayed in the output.
*/
public
function
testTitleOutput
()
{
$this
->
drupalGet
(
'test_page_display_200'
);
$view
=
Views
::
getView
(
'test_page_display'
);
$xpath
=
$this
->
cssSelect
(
'div.view:contains("'
.
$view
->
getTitle
()
.
'")'
);
$this
->
assertFalse
(
$xpath
,
'The view title was not displayed in the view markup.'
);
}
}
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display.yml
View file @
b4c0a16a
...
...
@@ -12,6 +12,7 @@ core: '8'
display
:
default
:
display_options
:
title
:
'
Test
page
display'
defaults
:
fields
:
false
pager
:
false
...
...
core/modules/views/views.theme.inc
View file @
b4c0a16a
...
...
@@ -28,6 +28,11 @@ function template_preprocess_views_view(&$variables) {
$variables
[
'css_name'
]
=
Html
::
cleanCssIdentifier
(
$id
);
$variables
[
'id'
]
=
$id
;
$variables
[
'display_id'
]
=
$view
->
current_display
;
// Override the title to be empty by default. For example, if viewing a page
// view, 'title' will already be populated in $variables. This can still be
// overridden to use a title when needed. See views_ui_preprocess_views_view()
// for an example of this.
$variables
[
'title'
]
=
''
;
// Basic classes.
$variables
[
'attributes'
][
'class'
]
=
array
();
...
...
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