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
dd14f70e
Commit
dd14f70e
authored
Jul 7, 2014
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2283049
by olli: Remove obsolete NodeController::page() method.
parent
69fd4ce1
Loading
Loading
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
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/node/src/Controller/NodeController.php
+2
-49
2 additions, 49 deletions
core/modules/node/src/Controller/NodeController.php
core/modules/node/src/Controller/NodeViewController.php
+8
-6
8 additions, 6 deletions
core/modules/node/src/Controller/NodeViewController.php
with
10 additions
and
55 deletions
core/modules/node/src/Controller/NodeController.php
+
2
−
49
View file @
dd14f70e
...
...
@@ -10,7 +10,6 @@
use
Drupal\Component\Utility\String
;
use
Drupal\Component\Utility\Xss
;
use
Drupal\Core\Controller\ControllerBase
;
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\Datetime\Date
;
use
Drupal\Core\DependencyInjection\ContainerInjectionInterface
;
use
Drupal\node\NodeTypeInterface
;
...
...
@@ -22,13 +21,6 @@
*/
class
NodeController
extends
ControllerBase
implements
ContainerInjectionInterface
{
/**
* The database connection.
*
* @var \Drupal\Core\Database\Connection
*/
protected
$database
;
/**
* The date service.
*
...
...
@@ -39,21 +31,18 @@ class NodeController extends ControllerBase implements ContainerInjectionInterfa
/**
* Constructs a NodeController object.
*
* @param \Drupal\Core\Database\Connection $database
* The database connection.
* @param \Drupal\Core\Datetime\Date $date
* The date service.
*/
public
function
__construct
(
Connection
$database
,
Date
$date
)
{
public
function
__construct
(
Date
$date
)
{
$this
->
date
=
$date
;
$this
->
database
=
$database
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'database'
),
$container
->
get
(
'date'
));
return
new
static
(
$container
->
get
(
'date'
));
}
...
...
@@ -237,42 +226,6 @@ public function revisionOverview(NodeInterface $node) {
return
$build
;
}
/**
* Displays a node.
*
* @param \Drupal\node\NodeInterface $node
* The node we are displaying.
*
* @return array
* An array suitable for drupal_render().
*/
public
function
page
(
NodeInterface
$node
)
{
$build
=
$this
->
buildPage
(
$node
);
foreach
(
$node
->
uriRelationships
()
as
$rel
)
{
$uri
=
$node
->
urlInfo
(
$rel
);
// Set the node path as the canonical URL to prevent duplicate content.
$build
[
'#attached'
][
'drupal_add_html_head_link'
][]
=
array
(
array
(
'rel'
=>
$rel
,
'href'
=>
$node
->
url
(
$rel
),
)
,
TRUE
);
if
(
$rel
==
'canonical'
)
{
// Set the non-aliased canonical path as a default shortlink.
$build
[
'#attached'
][
'drupal_add_html_head_link'
][]
=
array
(
array
(
'rel'
=>
'shortlink'
,
'href'
=>
$node
->
url
(
$rel
,
array
(
'alias'
=>
TRUE
)),
)
,
TRUE
);
}
}
return
$build
;
}
/**
* The _title_callback for the node.add route.
*
...
...
This diff is collapsed.
Click to expand it.
core/modules/node/src/Controller/NodeViewController.php
+
8
−
6
View file @
dd14f70e
...
...
@@ -31,8 +31,9 @@ public function view(EntityInterface $node, $view_mode = 'full', $langcode = NUL
array
(
'rel'
=>
$rel
,
'href'
=>
$node
->
url
(
$rel
),
)
,
TRUE
);
),
TRUE
,
);
if
(
$rel
==
'canonical'
)
{
// Set the non-aliased canonical path as a default shortlink.
...
...
@@ -40,8 +41,9 @@ public function view(EntityInterface $node, $view_mode = 'full', $langcode = NUL
array
(
'rel'
=>
'shortlink'
,
'href'
=>
$node
->
url
(
$rel
,
array
(
'alias'
=>
TRUE
)),
)
,
TRUE
);
),
TRUE
,
);
}
}
...
...
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