Part of #2259445: Entity Resource unification
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.
(Entities that have no links are not included below as they do not require any action.)
Config entities
- Block: #2314855: Standardize block entity route names
- ConfigTest: #2314859: Standardize ConfigTest route names
- DateFormat: #2314869: Standardize DateFormat entity route names
- FilterFormat: #2314765: Standardize filter format route names
- ImageStyle: #2314873: Standardize image style entity route names
- Language: #2314875: Standardize language entity route names
- ResponsiveImageMapping: #2314881: Standardize responsive image mapping entity route names
- SearchPage: #2314885: Standardize search page entity route names
- Role: #2314883: Standardize role entity route names
- View Mode / Field Mode: #2314871: Standardize Entity module entity route names
Content entities
- Feed / Item (Aggregator): #2314861: Standardize aggregator entity route names
- BlockContent / BlockContentType: #2314863: Standardize block content entity route names
- Comment / CommentType: #2314867: Standardize comment entity route names
- Message/Category (Contact): #2314865: Standardize contact entity route names
- MenuLinkContent: #2314877: Standardize menu link entity route names
- Node / NodeType: #2278567: Standardize node route names by relationship Assigned to: kgoel
- Shortcut / Shortcut Set: #2314887: Standardize shortcut entity route names
- EntityTest: #2314889: Standardize entity_test entity route names
- Term / Vocabulary: #2291833: Standardize taxonomy term entity route names
- User: #2291829: Standardize user route names
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.
Comment | File | Size | Author |
---|---|---|---|
#23 | 2285413-23.patch | 14.64 KB | andypost |
#23 | interdiff.txt | 7.27 KB | andypost |
Comments
Comment #1
Crell CreditAttribution: Crell commentedComment #2
Crell CreditAttribution: Crell commentedComment #3
Crell CreditAttribution: Crell commentedComment #4
Crell CreditAttribution: Crell commentedHoly crap we have a lot of entities... I'll make separate issues shortly unless someone wants to beat me to it. :-)
Comment #5
Crell CreditAttribution: Crell commentedComment #6
Crell CreditAttribution: Crell commentedI got bored on the plane back from Design4Drupal so ploughed through these. :-) We'll see if the tests actually pass.
The only one remaining, I think, is EntityTest, which as noted in its issue has a number of subclassed entities that do weird things with their links.
If there's a links-using entity I forgot, please add it to the list (and file a patch!)
Comment #7
bojanz CreditAttribution: bojanz commentedAs a result of this effort we now have inconsistent route names. Some are entity.$entity_type.$something, some aren't.
See how the add and list route names don't match the pattern? Yes, it's because that one is not semantically important, but at a glance it looks inconsistent, and it's bad DX having to think about and explain it.
Comment #8
Crell CreditAttribution: Crell commentedThis is a stepping stone toward most of the entity routes being auto-generated anyway, so any visual inconsistency in the routing.yml file will go away in time.
Comment #9
andypostThe last one left #2314889: Standardize entity_test entity route names
So closing the meta
Comment #10
dawehner:( https://www.drupal.org/node/2327373
Comment #11
andypostNow the last one is #2327373: Standardize view entity route names
Comment #12
dawehnerWe also forgot about menu_ui_entity_type_build()
Comment #13
andypost@dawehner good catch!
Questions:
1)
entity.menu_link_content.add_form
is defined in menu link content module but used in menu (same we have for term-add)2)
\Drupal\menu_link_content\Form\MenuLinkContentDeleteForm::getCancelUrl()
point to menu ui route but dependency is wrongComment #15
andypostFixed the test
EDIT: maybe better leave the name of contextual link as it was?
Comment #16
dawehner+1
RTBC once it is green.
Its not your fault, so +1
I am fine with that change!
Comment #17
andypostFiled follow-up for bug #2328883: menu ui route used in menu link content
Comment #18
Crell CreditAttribution: Crell commentedIt's green.
Comment #19
dawehnerThere we go.
Comment #20
dawehnerSorry but this simply can't work.
Comment #21
dawehnerOn top of that I recommend here to fix action module and contact module directly as well. https://www.drupal.org/node/2281645#comment-9102521 contains those changes already as well.
Comment #22
andypostmakes sense to fix action and contact.
please elaborate #20 - I can;t get what's wrong
Comment #23
andypostFixed #20 & #21
Comment #24
Crell CreditAttribution: Crell commentedI think we got 'em all this time? :-)
Comment #25
Dries CreditAttribution: Dries commentedCommitted to 8.0.x.
Comment #28
yukare CreditAttribution: yukare commentedJust a question about this issue: the change record notice is still a draft, any reason to not publish it ?
Comment #29
andypostpublished, also field_ui could update some routes in followup
Comment #30
andypostFollow-up is #2346883: Standardize field_ui entity route names