Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3338541
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3338541
Commits
6a059360
Commit
6a059360
authored
12 years ago
by
Daniel Wehner
Committed by
Tim Plunkett
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1793992
by dawehner | smiletrl: Fixed Add new displays will change the default displays?.
parent
6f920509
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
lib/Drupal/views/Tests/UI/DisplayTest.php
+7
-0
7 additions, 0 deletions
lib/Drupal/views/Tests/UI/DisplayTest.php
lib/Drupal/views/ViewUI.php
+3
-0
3 additions, 0 deletions
lib/Drupal/views/ViewUI.php
with
10 additions
and
0 deletions
lib/Drupal/views/Tests/UI/DisplayTest.php
+
7
−
0
View file @
6a059360
...
...
@@ -73,16 +73,23 @@ public function testRemoveDisplay() {
* Tests adding a display.
*/
public
function
testAddDisplay
()
{
// Show the master display.
config
(
'views.settings'
)
->
set
(
'ui.show.master_display'
,
TRUE
)
->
save
();
$settings
[
'page[create]'
]
=
FALSE
;
$view
=
$this
->
randomView
(
$settings
);
$path_prefix
=
'admin/structure/views/view/'
.
$view
[
'name'
]
.
'/edit'
;
$this
->
drupalGet
(
$path_prefix
);
$this
->
drupalPost
(
NULL
,
array
(),
t
(
'Save'
));
// Add a new display.
$this
->
drupalPost
(
NULL
,
array
(),
'Add Page'
);
// @todo Revising this after http://drupal.org/node/1793700 got in.
$this
->
assertLinkByHref
(
$path_prefix
.
'/page_1'
,
0
,
'Make sure after adding a display the new display appears in the UI'
);
$this
->
assertNoLink
(
'Master*'
,
0
,
'Make sure the master display is not marked as changed.'
);
$this
->
assertLink
(
'Page*'
,
0
,
'Make sure the added display is marked as changed.'
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
lib/Drupal/views/ViewUI.php
+
3
−
0
View file @
6a059360
...
...
@@ -789,6 +789,9 @@ public function submitDisplayAdd($form, &$form_state) {
$parents
=
$form_state
[
'triggering_element'
][
'#parents'
];
$display_type
=
array_pop
(
$parents
);
$display_id
=
$this
->
storage
->
addDisplay
(
$display_type
);
// A new display got added so the asterisks symbol should appear on the new
// display.
$this
->
current_display
=
$display_id
;
views_ui_cache_set
(
$this
);
// Redirect to the new display's edit page.
...
...
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