Create a new NodeRepository for the code from Drupal\node\NodeStorage

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.
The Node entity is overriding that class in Drupal\node\NodeStorage. The problem for the database driver for MongoDB is that it then also needs to override the methods in Drupal\node\NodeStorage. It also needs to duplicate the code inside Drupal\file\FileStorage too. Duplicating code is wrong.
Another problem is that the code in Drupal\node\NodeStorage class is that it is NOT extending the functionality from the class Drupal\Core\Entity\Sql\SqlContentEntityStorage. The extra code can easily being moved to another class.

Proposed resolution

- Create a new Drupal\node\NodeRepository class/service and move the code/methods from Drupal\node\NodeStorage to the new class/service.
- Deprecate the methods and the class Drupal\node\NodeStorage.

Remaining tasks

User interface changes

None

API changes

- New service node_repository with the methods revisionIds(), userRevisionIds(), countDefaultLanguageRevisions(), updateType() and clearRevisionsLanguage().
- The methods revisionIds(), userRevisionIds(), countDefaultLanguageRevisions(), updateType() and clearRevisionsLanguage() in the class Drupal\node\NodeStorage are deprecated.
- The class Drupal\node\NodeStorage is deprecated.

Data model changes

None

Release notes snippet

None

📌 Task
Status

Active

Version

11.0 🔥

Component
Node system 

Last updated 1 day ago

No maintainer
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