- Issue created by @daffie
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 User entity is overriding that class in Drupal\user\UserStorage. The problem for the database driver for MongoDB is that it then also needs to override the methods in Drupal\user\UserStorage. It also needs to duplicate the code inside Drupal\file\FileStorage too. Duplicating code is wrong.
Another problem is that the code in Drupal\user\UserStorage 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.
- Create a new Drupal\user\UserRepository class/service and move the code/methods from Drupal\user\UserStorage to the new class/service.
- Deprecate the methods from the class Drupal\user\UserStorage.
Warning: do not change the method Drupal\user\UserStorage::doSaveFieldItems()
.
None
- New service user_repository with the methods updateLastLoginTimestamp()
, updateLastAccessTimestamp()
and deleteRoleReferences()
.
- The methods updateLastLoginTimestamp()
, updateLastAccessTimestamp()
and deleteRoleReferences()
are deprecated.
None
None
Active
11.0 π₯
Last updated