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

Created on 23 October 2023, about 1 year 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 about 18 hours 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.71.5 2024