Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The CreatedItem field type is using REQUEST_TIME. It should use the time service instead.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2903549-8.patch | 2.21 KB | valthebald |
#4 | replace_request_time-2903549-4.patch | 697 bytes | BramDriesen |
Comments
Comment #2
joachim CreditAttribution: joachim commentedOops. Cloning cloned the status too!
Comment #3
joachim CreditAttribution: joachim commentedWe should probably wait to see why patch at #2902896: Replace REQUEST_TIME with time service in ChangedItem is failing tests before working on this.
Comment #4
BramDriesenReplaced REQUEST_TIME with \Drupal::time()->getRequestTime(). Don't think it's really related to the failed issue linked. So let's queue it for testing.
Comment #6
lmarkov CreditAttribution: lmarkov commentedCounted from today, Me (@lmarkov), @valthebald and @lachezar.valchev would be taking up the task.
Comment #7
joachim CreditAttribution: joachim commentedThis is a plugin, so it should be able to have the service injected.
Comment #8
valthebaldInjecting time service into CreatedItem plugin
Comment #9
valthebaldComment #11
valthebaldFieldType plugins are directly instantiated by TypedDataManager, which does not care about DI (see #2053415: Allow typed data plugins to receive injected dependencies). I have submitted a patch there, that would unblock this issue.
Comment #12
valthebaldComment #14
alexpottThank you for your work on cleaning up Drupal core's use of deprecated APIs!
In order to deprecate APIs in a maintainable way, converting deprecated uses should be replaced across all of core for a given kind of usage, rather than in individual modules or files. Such issues should also always be part of an overall plan to ensure all usages are removed, rather than standalone patches.
For background information on why we usually will not commit cleanups that aren't scoped in that way, see the core issue scope guidelines. See the core deprecation policy for more information on how we handle deprecations.
Contributing to the overall plan above will help ensure that your cleanups for core's deprecated code improve core in a maintainable and minimally disruptive way.
We need come up with a plan that's not class by class, file by file, module by module.
Comment #17
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedThis is being done for both
CreatedItem
andChangedItem
in #2809515: Simulate time passage instead of actually waiting in EntityTestMulChanged, so I'm going to close this one as a duplicate and credit everyone who worked on this patch.