Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In old #2495833 issue contentPermissions()
method has been removed in core/modules/node/src/NodePermissions.php.
Look at the difference below from issue #2495833:
diff --git a/core/modules/node/src/NodePermissions.php b/core/modules/node/src/NodePermissions.php
index 74a6442..dca4671 100644
--- a/core/modules/node/src/NodePermissions.php
+++ b/core/modules/node/src/NodePermissions.php
@@ -20,21 +20,6 @@ class NodePermissions {
use UrlGeneratorTrait;
/**
- * Gets an array of content permissions.
- *
- * @return array
- * The content permissions.
- */
- public function contentPermissions() {
- return array(
- 'access content overview' => array(
- 'title' => $this->t('Access the Content overview page'),
- 'description' => $this->t('Get an overview of <a href="!url">all content</a>.', array('!url' => $this->url('system.admin_content'))),
- ),
- );
- }
-
- /**
* Gets an array of node type permissions.
*
* @return array
Together with contentPermissions() method $this->url('system.admin_content')
has been removed so UrlGeneratorTrait
class is no longer needed there.
Proposed resolution
Class UrlGeneratorTrait
is no longer needed there, because it was only one reference to this class. Now it can be safely removed.
Remaining tasks
None
Comment | File | Size | Author |
---|---|---|---|
#2 | core-remove-unnecessary-UrlGeneratorTrait-from-node-3001312-2-D8.patch | 574 bytes | Krzysztof Domański |
Comments
Comment #2
Krzysztof DomańskiComment #3
Krzysztof DomańskiComment #4
Krzysztof DomańskiUpdated the Issue Summary in accordance with the standards.
Comment #5
longwaveComment #6
alexpottCommitted 0a8ea5e and pushed to 8.7.x. Thanks!