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.
Problem/Motivation
REQUEST_TIME constant was deprecated in #2717207: Add a time service to provide consistent interaction with time()/microtime() and superglobals, but there are 6 (5 in cron_example and 1 in render_example) usages in examples module.
Proposed resolution
Replace the constant with \Drupal::time()->getRequestTime()
Remaining tasks
- Write the patch
Comment | File | Size | Author |
---|---|---|---|
#9 | 3067769-9.patch | 5.5 KB | valthebald |
#5 | 3067769-5.patch | 5.38 KB | andypost |
#5 | interdiff.txt | 6.31 KB | andypost |
#4 | 3067769-2.patch | 6.07 KB | adadykina |
Comments
Comment #2
Lal_Comment #3
andypostController and form class should use to inject this service
Comment #4
adadykina CreditAttribution: adadykina commentedAdded dependency injections
Comment #5
andypostHere's a clean-up for last patch, I'd say RTBC
- do not call for time inside of loops
-
RenderExampleController
using static method for lazy builder so no way to use DI here- fix docs
@adadykina thanks for the patch, confirmed your account
Comment #6
jungleI guess this is fixed already
Comment #7
jungleThe default branch is 3.x-dev now
Comment #8
crifi CreditAttribution: crifi as a volunteer commentedThe REQUEST_TIME constants are still in the 3.x branch.
Comment #9
valthebaldRerolled the patch from #5, given that now modules are in a subfolder
Comment #11
valthebaldCommitted to 3.x, thanks everyone!