Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
entity system
Priority:
Critical
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Oct 2013 at 20:17 UTC
Updated:
29 Jul 2014 at 23:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirJust experimenting a bit.
As nice as having a group label would be, it's a) ugly to do something based on it and b) I have no idea how to have a translatable default group label there...
Comment #2
berdirComment #3
dawehnerWe should consider to keep maybe the storage controllers on some of the examples in order to show people how to override it.
On the other hand it is really great to simplify the initial work.
Comment #4
berdirChanged all config entities.
Deleted two storage controllers, one was empty and the other only contained methods that we don't call, because those pre/post thingies were moved to entity classes a long time ago.
Comment #5
berdirRe-roll.
Comment #6
msonnabaum commentedThis is definitely an improvement, but I dont get why getAnnotationReader is being made public in this patch.
Comment #7
berdirThat's just a left-over from experimenting, shouldn't have made it into the patch. I initially thought it would be necessary but as long as all the annotation classes are in the same directory, it just works.
Comment #8
tim.plunkettThis will need a reroll soon.
Comment #9
tim.plunkettJust to ensure I wasn't breaking the ability to do this with #2005716: Promote EntityType to a domain object, I've rerolled this now.
9A is the closest equivalent to a reroll.
9B shows some more options we have with how to deal with the different methods.
9C skips the annotation completely to use the new entity_type_class property directly.
All of these are suffixed with -do-not-test since they won't apply until the other issue goes in.
Comment #10
yched commentedThe c) option with the 'entity_type_class' looks weird - the @ annotation used points at a class, but the actual content of the annotation in fact points to a different (sub)class ?
Why would we go with that rather than a) / b) ?
Comment #11
tim.plunkettA and B both contain a \Drupal\Core\Entity\Annotation\EntityType class that have
public $entity_type_class = 'Drupal\Core\Config\Entity\ConfigEntityType';C just skips the middleman.
This is a reroll of B now that the blocker went in.
Comment #13
tim.plunkettSilly mistake.
Comment #14
dawehnerWhat happened with the ContentEntityType announced in the title?
Out of scope: Did we ever considered to automatically add the config entity list controller here?
Comment #15
tim.plunkettHah, forgot about that part.
There are 3 entity types that are neither config nor content (extend Entity directly):
FieldUITestNoBundle
EntityCacheTest
MenuLink
Comment #17
tim.plunkettFixing SearchPage.
Comment #18
damiankloip commentedRerolled, and made a couple of minor docs tweaks. Let's get this back on the road.
I would like to revive #2004336: Default UUID key in ConfigEntityType.
Comment #20
damiankloip commentedgetControllerClasses() happened.
Comment #22
damiankloip commented20: 2119905-20.patch queued for re-testing.
Comment #23
tstoecklerAre we sure it is safe deleting this? I don't see this being mentioned anywhere.
Comment #24
damiankloip commentedWell, these methods aren't used on storage controllers like this anymore, are they?
Comment #25
damiankloip commentedComment #26
tim.plunkettThis is dead code, the preSave() and preDelete() have been moved from the storage controller to the entity in #1893772: Move entity-type specific storage logic into entity classes
Looks good, thanks @damiankloip
Comment #27
alexpott2119905-20.patch no longer applies.
Comment #28
damiankloip commentedRerolled.
Comment #29
berdirI think your merge went wrong here? The class has been renamed AFAIK.
Wondering if we shouldn't add the default storage controller to content entities too, that should be FieldableDatabaseStorageController.
Also, should we move certain annotrations to the subclasses? Only config entities have a config_prefix, only content entities can be fieldable (should be extensible).
Comment #31
damiankloip commentedOk, so something like this?
I'm not sure about moving the fieldable stuff, as people could extend from EntityType and not use ContentEntityType but want to use fields etc?
Comment #33
damiankloip commentedWhoops
Comment #35
damiankloip commentedSorry.
Comment #37
damiankloip commentedShould fail less I think.
Comment #39
damiankloip commentedComment #41
damiankloip commentedThis should be it. SORRY.
Comment #42
dawehnerNice work.!
Comment #43
jibranPlease set back to RTBC once change record is created. Sorry for changing it back to NR.
Comment #44
damiankloip commentedAdded: https://drupal.org/node/2199111
Comment #45
alexpottThis blocks #2199483: Provide a default config_prefix based on entity type ID and provider which in turn blocks #2080823: Create API to discover config entities' soft dependencies and use this to present a confirm form on module uninstall
Comment #46
alexpottCommitted b0da3ae and pushed to 8.x. Thanks!
Comment #47
rszrama commentedThanks, this'll be helpful. : )
Comment #48
damiankloip commentedSome minor things crept in one of the re-rolls. It's just removing a couple of things.
Can we just add this here?
Comment #49
berdirYay, more code to remove :)
Comment #50
alexpottCommitted 8b40554 and pushed to 8.x. Thanks!