[META] Override Drupal\Core\Entity\Sql\SqlContentEntityStorage as little as possible

Created on 23 October 2023, 7 months ago

Problem/Motivation

The database driver for MongoDB needs to override the class Drupal\Core\Entity\Sql\SqlContentEntityStorage. MongoDB does document/JSON storage instead of relational database storage. A number of core entities are overriding that class. The problem for the database driver for MongoDB is that it then also needs to override the methods in those entity specific classes too. It also needs to duplicate the code inside those classes too. Duplicating code is wrong.
Another problem is that the code in those classes that are overriding Drupal\Core\Entity\Sql\SqlContentEntityStorage is NOT extending what the base class is doing. The extra code can easily being moved to another class/service.

Proposed resolution

Create for each of the entities that are overriding the class Drupal\Core\Entity\Sql\SqlContentEntityStorage and are NOT related to that class, a new repository and move the code in the overriding classes to the new repository. Deprecate the old override classes.

Remaining tasks

The following entities have an override for the class Drupal\Core\Entity\Sql\SqlContentEntityStorage:
- Comment
- File
- Media
- MenuLinkContent
- Node
- PathAlias
- Term
- User

πŸ“Œ Task
Status

Closed: duplicate

Version

11.0 πŸ”₯

Component
EntityΒ  β†’

Last updated 1 day ago

Created by

πŸ‡³πŸ‡±Netherlands daffie

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024