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
301
Merge Requests
301
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
db7834de
Commit
db7834de
authored
Oct 11, 2016
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2810057
by arijits.drush, Lendude: WSOD after renaming and deleting a views display
parent
b0abe179
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
core/modules/views_ui/src/Tests/DisplayCRUDTest.php
core/modules/views_ui/src/Tests/DisplayCRUDTest.php
+10
-0
core/modules/views_ui/src/ViewEditForm.php
core/modules/views_ui/src/ViewEditForm.php
+1
-1
No files found.
core/modules/views_ui/src/Tests/DisplayCRUDTest.php
View file @
db7834de
...
...
@@ -81,6 +81,16 @@ public function testRemoveDisplay() {
$this
->
drupalPostForm
(
NULL
,
array
(),
t
(
'Save'
));
$this
->
assertNoLinkByHref
(
$path_prefix
.
'/page_1'
,
'Make sure there is no display tab for the deleted display.'
);
// Test deleting a display that has a modified machine name.
$view
=
$this
->
randomView
();
$machine_name
=
'new_machine_name'
;
$path_prefix
=
'admin/structure/views/view/'
.
$view
[
'id'
]
.
'/edit'
;
$this
->
drupalPostForm
(
"admin/structure/views/nojs/display/
{
$view
[
'id'
]
}
/page_1/display_id"
,
array
(
'display_id'
=>
$machine_name
),
'Apply'
);
$this
->
drupalPostForm
(
NULL
,
array
(),
'Delete Page'
);
$this
->
drupalPostForm
(
NULL
,
array
(),
t
(
'Save'
));
$this
->
assertResponse
(
200
);
$this
->
assertNoLinkByHref
(
$path_prefix
.
'/new_machine_name'
,
'Make sure there is no display tab for the deleted display.'
);
}
/**
...
...
core/modules/views_ui/src/ViewEditForm.php
View file @
db7834de
...
...
@@ -266,7 +266,7 @@ public function save(array $form, FormStateInterface $form_state) {
// Rename display ids if needed.
foreach
(
$executable
->
displayHandlers
as
$id
=>
$display
)
{
if
(
!
empty
(
$display
->
display
[
'new_id'
]))
{
if
(
!
empty
(
$display
->
display
[
'new_id'
])
&&
empty
(
$display
->
display
[
'deleted'
])
)
{
$new_id
=
$display
->
display
[
'new_id'
];
$display
->
display
[
'id'
]
=
$new_id
;
unset
(
$display
->
display
[
'new_id'
]);
...
...
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