Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
e3d7216f
Commit
e3d7216f
authored
Dec 27, 2013
by
webchick
Browse files
Issue
#2163003
by andypost: Node addition is broken when only one content type exists.
parent
588e6783
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/node/lib/Drupal/node/Controller/NodeController.php
View file @
e3d7216f
...
...
@@ -43,7 +43,7 @@ public function addPage() {
// Bypass the node/add listing if only one content type is available.
if
(
count
(
$content
)
==
1
)
{
$type
=
array_shift
(
$content
);
return
$this
->
redirect
(
'node
_
add'
,
array
(
'node_type'
=>
$type
->
type
));
return
$this
->
redirect
(
'node
.
add'
,
array
(
'node_type'
=>
$type
->
type
));
}
return
array
(
...
...
core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php
View file @
e3d7216f
...
...
@@ -43,6 +43,11 @@ function setUp() {
* Creates a "Basic page" node and verifies its consistency in the database.
*/
function
testNodeCreation
()
{
// Test /node/add page with only one content type.
entity_load
(
'node_type'
,
'article'
)
->
delete
();
$this
->
drupalGet
(
'node/add'
);
$this
->
assertResponse
(
200
);
$this
->
assertUrl
(
'node/add/page'
);
// Create a node.
$edit
=
array
();
$edit
[
'title[0][value]'
]
=
$this
->
randomName
(
8
);
...
...
Write
Preview
Supports
Markdown
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