Problem/Motivation
The History service is sometimes slow and only works for the entity type node. All queries are hardcoded and cannot be replaced by contrib.
Proposed resolution
Introduce swappable HistoryRepository service to allow more performant implementations in contrib to figure out actual needs and help to make improvements in newer version of core.
Remaining tasks
Implement HistoryRepository and HistoryRepositoryInterface. (done)
Replace all usages of history table with proper service calls. (done)
User interface changes
No
API changes
Deprecated functions:history_read($nid)
and history_read_multiple($nids)
- HistoryRepositoryInterface::getLastViewed($entity_type, $entity_ids, AccountInterface $account)
history_write($nid, AccountInterface $account = NULL)
- updateLastViewed(EntityInterface $entity, AccountInterface $account)
Related Issues
#1029708: History table for any entity
#2078753: Add history_read_multiple()
#1991684: Node history markers (comment & node "new" indicator, "x new comments" links) forces render caching to be per user