Part of #1976158: Rename entity storage/list/form/render "controllers" to handlers.
EntityStorageControllerInterface => EntityStorageInterface
EntityStorageControllerBase => EntityStorageBase
ConfigStorageController => ConfigEntityStorage
DatabaseStorageController => EntityDatabaseStorage
FieldableEntityStorageControllerInterface => FieldableEntityStorageInterface
FieldableEntityStorageControllerBase => ContentEntityStorageBase
FieldableDatabaseStorageController => ContentEntityDatabaseStorage
Other entity storage controllers => just need to remove "Controller" suffix
EntityManager->getStorageController()
=> EntityManager->getStorage()
Update entity_get_controller()
and other variables and property names
Before:
After:
Comment | File | Size | Author |
---|---|---|---|
#53 | entity_classes_before.png | 19.93 KB | xjm |
#48 | 2188613-storage-48-interdiff.txt | 1.66 KB | Berdir |
#48 | 2188613-storage-48.patch | 634.61 KB | Berdir |
#46 | 2188613-storage-46-interdiff.txt | 7.09 KB | Berdir |
#46 | 2188613-storage-46.patch | 634.62 KB | Berdir |
Comments
Comment #1
Xen CreditAttribution: Xen commentedI'll take a stab at this.
Comment #2
Xen CreditAttribution: Xen commentedSome progress, I have a test site up and running again after the great rename. Tomorrow I'll weed out some failing tests.
Comment #3
Xen CreditAttribution: Xen commentedI'm getting some very weird fallout on the tests, that doesn't make much sense. Aggregator fails on feed items never hitting the DB, but entity tests passes. drupal_render and readonly stream wrappers fails.
I have to dig deeper to figure out what goes wrong here..
Comment #4
Xen CreditAttribution: Xen commentedNow that was stupid. twig_debug in settings file killing random tests.
Let's see what the testbot thinks.
Comment #6
Xen CreditAttribution: Xen commentedDamn, this is virtually impossible to keep up to date with HEAD. Two days, and there's merge conflicts in 26 files.
Comment #7
BerdirWell, #2165155: Change $entity_type to $entity_type_id and $entity_info to $entity_type/$entity_types just got in, which changed all the constructor arguments.
That said, looks like your patch does not correctly move the files but deletes and re-adds all content, make sure you have git configured properly, the patch should *not* be almost 1MB :)
You should be able to do the merge by applying on an older version and then rebasing/merging with head, I'd expect that might work for most conflicts.
Comment #8
Xen CreditAttribution: Xen commented@berdir
Ah, yes that'll explain it.
Which git configuration is that?
Well, the 26 files is in rebasing, mostly the mentioned constructors.
Rebasing as we speak...
Comment #9
Xen CreditAttribution: Xen commentedOK, rerolled.
Comment #10
Xen CreditAttribution: Xen commentedWoops, and status.
Comment #12
Xen CreditAttribution: Xen commentedNow that's some odd errors. Token fails?
I'll look into it later.
Comment #13
Xen CreditAttribution: Xen commentedFixed the failing tests and re-rolled.
Comment #14
BerdirVery nice work!
Here's a re-roll, tons of conflicts and a few new replacements. Also found a new pattern to replace $this->storageController => $this->storage. somethingStorage or entityStorage might be better, not sure.
Comment #16
BerdirUps.
Comment #18
andypostAnd another small fix
Comment #19
plachComment #20
BerdirRe-roll and new replacement pattern: "storage controller" => "storage". We however sometimes also refer to config/extension storage as storage controller...
Comment #22
BerdirFixed some left-over storageController property usage.
Comment #24
Sutharsan CreditAttribution: Sutharsan commentedNeeds reroll. But that may need to wait until #2120871: Rename EntityListController to EntityListBuilder gets committed.
Comment #25
BerdirWorking on a re-roll.
Comment #26
BerdirOk, let's try how this goes.
Comment #27
andypost@berdir please puthis to field api sandbox, patch looks great but needs +1 to rtbc
Comment #28
BerdirYeah, sorry, I forgot.
We discussed it and we're going to schedule the commit during the next few days, meaning we'll time the re-roll, review and then commit it asap.
Comment #29
BerdirAnother re-roll. I don't think the sandbox helps because there aren't multiple people working on it, just re-rolls. And I prefer doing those with rebase.
Comment #31
BerdirYou shouldn't be re-rolling this patch against an old HEAD :)
Comment #33
BerdirComment #35
BerdirAnd one more...
Comment #37
BerdirOk, here is another update that renames the following classes as discussed (already based on the renames we're already doing):
FieldableEntityStorageInterface => ExtendableEntityStorageInterface
FieldableEntityStorageBase => ContentEntityStorageBase
FieldableDatabaseEntityStorage => ContentEntityDatabaseStorage
DatabaseEntityStorage => EntityDatabaseStorage
I've also made nice pictures of the before after.
Before:
After:
Comment #39
BerdirAnd.. another re-roll.
Comment #41
BerdirOne file didn't get renamed. Also found FieldableNullStorage and renamed that too to ContentEntityNullStorage which makes much more sense.
Comment #43
BerdirToo late to work on something like this.
Comment #44
tim.plunketts/Extendable/Extensible? Not sure that extendable is really a word.
Also that interface has no docblock, so it's hard to tell what it's for.
Comment #46
BerdirRe-roll, clean-up, fixing tests. Not sure where that text summary change was coming from, reverted, doesn't belong in here.
Comment #47
alexpotthttps://english.stackexchange.com/questions/90426/extensible-vs-extendible
So this seems Extensible
Comment #48
BerdirOk, after quite some discussion with @alexpott, we decided to *not* rename the interface. The initial argument for doing it here that it would affect a lot of places, but with the actual implementations renamed to ContentEntity*, which makes a lot of sense and everyone agrees with I think, renaming the interface becomes a trivial task (see interdiff) and can be discussed in #2100343: Remove 'fieldable' key in entity definitions in favour of 'field_ui_base_route'.
Comment #49
alexpottGreat - let's proceed. I've read the patch and checked that all the old names are not appearing in HEAD anywhere.
Comment #50
BerdirComment #51
catchCommitted/pushed to 8.x, thanks!
Comment #53
xjmFor posterity, here is the "before" with its filename fixed.
Comment #55
Sutharsan CreditAttribution: Sutharsan commentedFor info. I've created this issue to remove some remaining references to Entity Storage Controller (mainly in comments): #2248051: Remove last references to Entity Storage Controller