Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
31 Dec 2013 at 17:36 UTC
Updated:
29 Jul 2014 at 23:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fago#2005716: Promote EntityType to a domain object went in.
Comment #2
berdirWell, I guess that's what we get for renames like this :)
Only renamed $entity_info/$info and $entity-type just when it was in the way. No idea how to identify $entity_type's that are ID's, also not sure if we need to.
One part I didn't touch, and that's hook_entity_info() and the _alter(), not sure what to do about that' Just rename $entity_info and worry about the hook in a different issue?
Comment #3
tim.plunkettWe could do the renaming of the alter in #1981858: Rename hook_entity_info/alter() to hook_entity_type_build/alter() as well.
Comment #5
berdirDoing the hook rename over there would be OK with me.
Missed to update route defaults/arguments, this should fix most of those tests, didn't check if all are due to this.
Comment #7
berdirFixing more routing stuff...
Comment #9
tim.plunkettBad regex I guess, these changes to modules/config weren't needed.
Comment #10
berdirI didn't do any regex-ing, that was all PhpStorm rename refactoring, weird. it did something similar to some other arguments.
I tried that form manually and it worked, so I didn't look closer, I guess I just tested the ajax part that still worked?
Comment #11
tim.plunkettYeah, those arguments are only used if you deep-link to a specific export, or use the form with AJAX off.
Comment #12
dawehnerLet's fill a follow up to change the entity query class to also use something like getEntityTypeId.
it is a bit sad that we should probably better update the documentation in another follow up. this patch is big enough already.
Another follow up: typehint all those instances.
My head thought for a while that entityId is an interface, luckily it won't and my head did not exploded.
Comment #13
berdirThanks for the review!
1. #2191651: Rename Drupal\Core\Entity\Query\QueryInterface::getEntityType() to getEntityTypeId()
2. Fixed all "entity info" that made sense in this context, left a few related to entity_info_cache_clear() and hook_entity_info(), will clean that up in the issue mentioned above.
3. #2191655: Type hint $entity_type everywhere it is an instance of EntityTypeInterface.
4. Yeah, PhpStorm doesn't like our buildForm() trick with additional optional arguments. If you try to rename a variable there, it attempts to match that *somehow* in all buildForm() implemetnations we have. For example, I tried to rename that back using PhpStorm and it removed _$id from $action_id, $ban_id, $entity_type_id, $test_id and so on, $resulting in $ban_, $action_, o.0
Together with #1981858: Rename hook_entity_info/alter() to hook_entity_type_build/alter(), which I will address next, this should allow us to remove "entity_info" completely :)
Comment #14
berdirRe-roll.
Comment #15
dawehnerAwesome
Comment #16
berdir14: rename-entity-info-2165155-14.patch queued for re-testing.
Comment #17
berdir14: rename-entity-info-2165155-14.patch queued for re-testing.
Comment #18
alexpottCommitted 6c2ed3f and pushed to 8.x. Thanks!