Part of #2285413: [Meta] Standardize entity route names, which is part of #2259445: Entity Resource unification

Standardize all user entity route names to a standard format, as described below.

Problem/Motivation

Let's make any API changes now for the parent issue so that it doesn't block beta.

Proposed resolution

In order to get the API changes taken care of up-front for the parent issue, we are going to rename all of the entity-related routes to match what they will be once they are auto-generated. That way, once we start auto-generating them we can remove the static ones or not and there's no affect on module developers.

Remaining tasks

Rename all entity HTML routes to match a common format.

The common format is: entity.$entityname.$relationship, where $entityname is the machine name of the entity and $relationship is the relationship as defined in the entity annotation, machine-name-ified. (Convert - to _).

This requires a change to the entity annotation, the defined routes, and any generator calls to those routes.

User interface changes

None.

API changes

Many routes will have different names. Otherwise no change.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Crell’s picture

Issue summary: View changes
kgoel’s picture

kgoel’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: standardize-user-route-names-2291829-2.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
FileSize
16.44 KB

Status: Needs review » Needs work

The last submitted patch, 5: standardize-user-route-names-2291829-5.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
FileSize
16.75 KB

Removed canonical route name for testing

Status: Needs review » Needs work

The last submitted patch, 7: standardize-user-route-names-2291829-7.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
FileSize
16.82 KB

Status: Needs review » Needs work

The last submitted patch, 9: standardize-user-route-names-2291829-9.patch, failed testing.

Crell’s picture

Title: [Meta] Standardize user route names » Standardize user route names

This is not a meta.

kgoel’s picture

Status: Needs work » Needs review
FileSize
2.98 KB
kgoel’s picture

Status: Needs review » Needs work

The last submitted patch, 13: standardize-user-route-names-2291829-13.patch, failed testing.

Crell’s picture

Issue summary: View changes
Crell’s picture

Issue summary: View changes
kgoel’s picture

Status: Needs work » Needs review
FileSize
20.03 KB

Status: Needs review » Needs work

The last submitted patch, 17: standardize-user-route-names-2291829-17.patch, failed testing.

dawehner’s picture

Status: Needs work » Reviewed & tested by the community
FileSize
19.62 KB
414 bytes

Please don't grant me. The patch itself looks really fine, there is just this one small problem, see interdiff.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

Needs a reroll

git ac https://www.drupal.org/files/issues/standardize-user-route-names-2291829-19.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 20094  100 20094    0     0  31055      0 --:--:-- --:--:-- --:--:-- 76988
error: patch failed: core/modules/user/src/Plugin/Menu/MyAccountMenuLink.php:21
error: core/modules/user/src/Plugin/Menu/MyAccountMenuLink.php: patch does not apply
kgoel’s picture

Status: Needs work » Needs review
FileSize
19.63 KB
dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for the reroll

alexpott’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs reroll

Committed b428eda and pushed to 8.0.x. Thanks!

diff --git a/core/modules/user/src/Plugin/Menu/MyAccountMenuLink.php b/core/modules/user/src/Plugin/Menu/MyAccountMenuLink.php
index 0ab054a..ef172ec 100644
--- a/core/modules/user/src/Plugin/Menu/MyAccountMenuLink.php
+++ b/core/modules/user/src/Plugin/Menu/MyAccountMenuLink.php
@@ -21,8 +21,8 @@ public function isEnabled() {
     // The path 'user' must be accessible for anonymous users, but only visible
     // for authenticated users. Authenticated users should see "My account", but
     // anonymous users should not see it at all.
-    // @todo Re-write this as a link to entity.user.canonical with dynamic route parameters
-    //   to affect access since hidden should not be dynamic.
+    // @todo Re-write this as a link to entity.user.canonical with dynamic route
+    //   parameters to affect access since hidden should not be dynamic.
     //   https://www.drupal.org/node/2306991
     return $this->pluginDefinition['enabled'] && !\Drupal::currentUser()->isAnonymous();
   }

reflowed comment on commit.

  • alexpott committed b428eda on 8.0.x
    Issue #2291829 by kgoel, dawehner | Crell: Standardize user route names.
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.