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:

CommentFileSizeAuthor
#53 entity_classes_before.png19.93 KBxjm
#48 2188613-storage-48-interdiff.txt1.66 KBBerdir
#48 2188613-storage-48.patch634.61 KBBerdir
#46 2188613-storage-46-interdiff.txt7.09 KBBerdir
#46 2188613-storage-46.patch634.62 KBBerdir
#43 2188613-storage-43-interdiff.txt682 bytesBerdir
#43 2188613-storage-43.patch633.28 KBBerdir
#41 2188613-storage-41-interdiff.txt1.07 KBBerdir
#41 2188613-storage-41.patch633.28 KBBerdir
#39 2188613-storage-39-interdiff.txt6.16 KBBerdir
#39 2188613-storage-39.patch633.13 KBBerdir
#37 2188613-storage-36-interdiff.txt49.09 KBBerdir
#37 2188613-storage-36.patch632.47 KBBerdir
#37 after.png17.29 KBBerdir
#37 before.png19.93 KBBerdir
#35 2188613-storage-35.patch632.02 KBBerdir
#35 2188613-storage-35-interdiff.txt4.71 KBBerdir
#33 2188613-storage-33-interdiff.txt817 bytesBerdir
#33 2188613-storage-33.patch634.21 KBBerdir
#31 2188613-storage-31-interdiff.txt1.4 KBBerdir
#31 2188613-storage-31.patch631.87 KBBerdir
#29 2188613-storage-29.patch633.4 KBBerdir
#26 2188613-storage-26-interdiff.txt31.99 KBBerdir
#26 2188613-storage-26.patch624.66 KBBerdir
#22 2188613-storage-22-interdiff.txt3.72 KBBerdir
#22 2188613-storage-22.patch602.94 KBBerdir
#20 2188613-storage-20-interdiff.txt101.86 KBBerdir
#20 2188613-storage-20.patch600.29 KBBerdir
#18 2188613-storage-18.patch568.62 KBandypost
#18 interdiff.txt879 bytesandypost
#16 drupal-controller_rename-2188613-16-interdiff.txt2.34 KBBerdir
#16 drupal-controller_rename-2188613-16.patch568.62 KBBerdir
#14 drupal-controller_rename-2188613-14-interdiff.txt49.41 KBBerdir
#14 drupal-controller_rename-2188613-14.patch567.58 KBBerdir
#13 drupal-controller_rename-2188613-13.patch564.74 KBXen
#9 drupal-controller_rename-2188613-9.patch560.64 KBXen
#4 drupal-controller_rename-2188613-4.patch881.51 KBXen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xen’s picture

Assigned: Unassigned » Xen

I'll take a stab at this.

Xen’s picture

Some progress, I have a test site up and running again after the great rename. Tomorrow I'll weed out some failing tests.

Xen’s picture

I'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..

Xen’s picture

Status: Active » Needs review
FileSize
881.51 KB

Now that was stupid. twig_debug in settings file killing random tests.

Let's see what the testbot thinks.

Status: Needs review » Needs work

The last submitted patch, 4: drupal-controller_rename-2188613-4.patch, failed testing.

Xen’s picture

Damn, this is virtually impossible to keep up to date with HEAD. Two days, and there's merge conflicts in 26 files.

Berdir’s picture

Well, #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.

Xen’s picture

@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...

Xen’s picture

OK, rerolled.

Xen’s picture

Status: Needs work » Needs review

Woops, and status.

Status: Needs review » Needs work

The last submitted patch, 9: drupal-controller_rename-2188613-9.patch, failed testing.

Xen’s picture

Now that's some odd errors. Token fails?

I'll look into it later.

Xen’s picture

Status: Needs work » Needs review
FileSize
564.74 KB

Fixed the failing tests and re-rolled.

Berdir’s picture

Very 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.

Status: Needs review » Needs work

The last submitted patch, 14: drupal-controller_rename-2188613-14.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
568.62 KB
2.34 KB

Ups.

Status: Needs review » Needs work

The last submitted patch, 16: drupal-controller_rename-2188613-16.patch, failed testing.

andypost’s picture

Status: Needs work » Needs review
FileSize
879 bytes
568.62 KB

And another small fix

plach’s picture

Issue summary: View changes
Berdir’s picture

Re-roll and new replacement pattern: "storage controller" => "storage". We however sometimes also refer to config/extension storage as storage controller...

Status: Needs review » Needs work

The last submitted patch, 20: 2188613-storage-20.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
602.94 KB
3.72 KB

Fixed some left-over storageController property usage.

Status: Needs review » Needs work

The last submitted patch, 22: 2188613-storage-22.patch, failed testing.

Sutharsan’s picture

Issue tags: +Needs reroll

Needs reroll. But that may need to wait until #2120871: Rename EntityListController to EntityListBuilder gets committed.

Berdir’s picture

Assigned: Xen » Berdir

Working on a re-roll.

Berdir’s picture

Assigned: Berdir » Unassigned
Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
624.66 KB
31.99 KB

Ok, let's try how this goes.

andypost’s picture

Berdir’s picture

Yeah, 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.

Berdir’s picture

FileSize
633.4 KB

Another 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.

Status: Needs review » Needs work

The last submitted patch, 29: 2188613-storage-29.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
631.87 KB
1.4 KB

You shouldn't be re-rolling this patch against an old HEAD :)

Status: Needs review » Needs work

The last submitted patch, 31: 2188613-storage-31.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
634.21 KB
817 bytes

Status: Needs review » Needs work

The last submitted patch, 33: 2188613-storage-33.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
4.71 KB
632.02 KB

And one more...

Status: Needs review » Needs work

The last submitted patch, 35: 2188613-storage-35.patch, failed testing.

Berdir’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
19.93 KB
17.29 KB
632.47 KB
49.09 KB

Ok, 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:

Status: Needs review » Needs work

The last submitted patch, 37: 2188613-storage-36.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
633.13 KB
6.16 KB

And.. another re-roll.

Status: Needs review » Needs work

The last submitted patch, 39: 2188613-storage-39.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
633.28 KB
1.07 KB

One file didn't get renamed. Also found FieldableNullStorage and renamed that too to ContentEntityNullStorage which makes much more sense.

Status: Needs review » Needs work

The last submitted patch, 41: 2188613-storage-41.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
633.28 KB
682 bytes

Too late to work on something like this.

tim.plunkett’s picture

s/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.

Status: Needs review » Needs work

The last submitted patch, 43: 2188613-storage-43.patch, failed testing.

Berdir’s picture

Status: Needs work » Needs review
FileSize
634.62 KB
7.09 KB

Re-roll, clean-up, fixing tests. Not sure where that text summary change was coming from, reverted, doesn't belong in here.

alexpott’s picture

https://english.stackexchange.com/questions/90426/extensible-vs-extendible

I use the terms as Jim does in the context of Computer Science. In a computer program, if I add subroutines or blocks it is extendable - I can add more blocks. If the program is extensible, the individual blocks may be made more complex by modification, usually adding flexibility.

So this seems Extensible

Berdir’s picture

Ok, 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'.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

Great - let's proceed. I've read the patch and checked that all the old names are not appearing in HEAD anywhere.

Berdir’s picture

Issue summary: View changes
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

  • Commit 2f959b9 on 8.x by catch:
    Issue #2188613 by Berdir, Xen, andypost: Rename EntityStorageController...
xjm’s picture

Issue summary: View changes
FileSize
19.93 KB

For posterity, here is the "before" with its filename fixed.

Status: Fixed » Closed (fixed)

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

Sutharsan’s picture

For 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