- Issue created by @mstrelan
- First commit to issue fork.
- 🇮🇳India kalpanajaiswal
A MR raised to add the deprecation message.
Deprecate Procedural Fallback (This Issue) DONE
Add an @trigger_error() deprecation when function_exists() returns TRUE.This will alert contrib and custom module developers that they need to stop using *_last_viewed() functions before Drupal 12.
No behavior change yet — just the deprecation message.
- 🇮🇳India kalpanajaiswal
Future replacement step
Replace with a Service-based System
In the long term, replace the dynamic *_last_viewed() fallback with a proper service-based system:Introduce a LastViewedTimestampProviderInterface.
Allow entity-type-specific services using tagged service discovery (e.g., for nodes, media, custom entities).
Make the logic injectable, overrideable, and fully testable — following modern Drupal architecture.
Example$timestamp = $this->lastViewedManager->getLastViewedTimestamp($entity);
Where lastViewedManager is a new core service that aggregates entity-type-specific providers.
- 🇨🇭Switzerland berdir Switzerland
The whole section is in a module exists check for history, there's an existing issue to move this out: 📌 Remove uage of history module from comment module Active as history is being moved out of core, this will need to be pluggable somehow, through a hook or something.
I'd consider making this a duplicate of that issue.
- 🇨🇭Switzerland berdir Switzerland
crosspost on the status change, but the deprecation message doesn't make sense. Someone else cant just come up with a service to replace his, it's something that needs to be initiated by comment module.
- 🇦🇺Australia mstrelan
The whole section is in a module exists check for history, there's an existing issue to move this out
That's a great point, perhaps we can let history.module handle this in contrib, e.g. by providing a hook.
I'd consider making this a duplicate of that issue.
Instead I've postponed it so it doesn't get lost, and moved it to history.module component. I think the sequence should go something like this:
- Move the existing code to history.module
- Deprecate history.module in core
- Move issues for history.module over to contrib
- Create a hook or other path forward
- Deprecate relying on the magic named functions