Problem/Motivation
Split plugins out from #3112298: Replace REQUEST_TIME in classes with direct container access to reduce the size of the changed.
This issue deals specifically with replace those calls in plugins with direct container access.
The plugins and classes with direct container access that were identified to have those calls are:
- \Drupal\datetime\Plugin\views\argument\Date
- \Drupal\history\Plugin\views\filter\HistoryUserTimestamp
- \Drupal\views\Plugin\views\argument\Date
- \Drupal\views\Plugin\views\cache\Time
- \Drupal\views\Plugin\views\field\Date
- \Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter
Proposed resolution
- Remove deprecated uses of REQUEST_TIME and time() and others.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3395986
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3395986-replace-requesttime-in
changes, plain diff MR !5095
Comments
Comment #3
quietone commentedComment #5
spokjeSeems like the excellent work of @quietone was overlooked due to this issue being stuck on Active instead of NR.
Updated the deprecation notices and CR to mention 10.3.0 and removed the now deemed superfluous deprecation tests.
Comment #6
taran2lAdded a few suggestions so this one is consistent with #3113971: Replace REQUEST_TIME in services, see the commit https://git.drupalcode.org/project/drupal/-/commit/fd75fa213472e2029fded...
Then, I see other issue here: #3112295: Replace REQUEST_TIME in rest of OO code (except for tests), but it seems that at least some of the examples from that issue actually should be here like field plugins?
Comment #7
taran2lComment #9
andypostAddressed feedback (there was some typos)
Comment #10
smustgrave commentedLeft a comment.
Comment #11
andypostFixed CR link
Comment #12
smustgrave commentedVerified CR link is fixed and appears rest of threads have been addressed
Comment #13
taran2lThere is at least one more place where plugin with direct access exists, setting back to needs work ..
The identified plugins:
- \Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter
Comment #14
taran2lI've manually checked phpstan baseline file and all other occurrences are either in OO code without container access, or in tests (there are separate issues for that)
Setting back to NR
PS Added a tiny change to UpdateProcessor which slipped away from the #3113971: Replace REQUEST_TIME in services. I think this is a better place than other open issues
Comment #15
andypostThanks for CR update, rtbc++
Comment #16
taran2lOK, should be good to go now
Comment #17
catchWent to commit this but it needs a rebase for phpstan-baseline.neon
Comment #18
spokjeRebase only (with a PHPStan baseline run), so back to RTBC
Comment #20
catchCommitted/pushed to 11.x, thanks!