Problem/Motivation

Entity storage controllers require entity information, so they currently have to call entity_get_info(). This is not only bad in terms of dependency injection, but can lead to recursion, if you need to access the storage controller while building the entity info.
(This bit us in #1043198: Convert view modes to ConfigEntity, but in the end we ended up not needing this change.)

Proposed resolution

Pass in the entity info into the storage controllers. Luckily, storage controllers are instantiated exactly once in core (entity_get_controller()) and that already has the entity info at hand.

Remaining tasks

Review and commit the patch.

User interface changes

None.

API changes

None, since the constructor is not part of the interface anymore, here. (We might want to add it back, because in this case, we always pass the same, hardcoded arguments.) For people doing contrib storage controllers, it will be a change, but most of the time, they will need the entity info anyway, so. It's also a BC-compatible change (it *adds* an argument).

CommentFileSizeAuthor
#1 1828640-1-entity-storage-info.patch3.83 KBtstoeckler

Comments

tstoeckler’s picture

Status: Active » Needs review
StatusFileSize
new3.83 KB

Here we go.

berdir’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)

That happened :)