Problem/Motivation

From https://www.drupal.org/project/drupal/issues/2902895#comment-13461286

@catch and @alexpott agreed in Slack to postpone removing the constant to D10 as it seems like a lot of work is left that close to the first beta deadline. We can keep working on its removal in core but should also do an issue to change the deprecation message. And I guess remove it again from the hardcoded list in phpstan-drupal?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

mpdonadio created an issue. See original summary.

mpdonadio’s picture

Status: Active » Needs review
Issue tags: +Needs change record updates
StatusFileSize
new536 bytes
longwave’s picture

Status: Needs review » Reviewed & tested by the community

+1, we aren't going to finish this in the D9 beta window given the complexities discovered so far.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed f32344341b to 9.0.x and 8f72af8913 to 8.9.x and 235845c4de to 8.8.x. Thanks!

Backported to 8.8.x as this is a docs fix

  • alexpott committed f323443 on 9.0.x
    Issue #3113284 by mpdonadio: Move deprecation of REQUEST_TIME to Drupal...

  • alexpott committed 8f72af8 on 8.9.x
    Issue #3113284 by mpdonadio: Move deprecation of REQUEST_TIME to Drupal...

  • alexpott committed 235845c on 8.8.x
    Issue #3113284 by mpdonadio: Move deprecation of REQUEST_TIME to Drupal...
catch’s picture

Status: Fixed » Active

If we're not sure it's possible to remove all usages, should we actually undeprecate this (still with a recommendation to use the service), then re-deprecate in 9.x when we've removed all the usages?

alexpott’s picture

I think it is possible to remove all the usages. But maybe we should update the deprecation message again to say if the Drupal service layer is not present what to do. See #3104566: Implement Server Timing performance metrics for example where we use $request->server->get('REQUEST_TIME_FLOAT').

catch’s picture

mpdonadio’s picture

Status: Active » Needs review
StatusFileSize
new624 bytes
new497 bytes

I think we can remove all usages, it's just a lot of work. Not wed to the language, but I think the deprecation message can just reference the change record in it (like in FieldMigration). And then we can update the CR to

- Change Drupal 9 to Drupal 10
- Add a "Caveats" section (again, not wed to the word) that lists some situations where pulling from the $request or $_SERVER really is most appropriate, since most(?) of those usages would be edge cases the majority of developers need to use.

?

hardik_patel_12’s picture

StatusFileSize
new497 bytes

Patch is failed to apply that's why re-applying patch.

catch’s picture

Status: Needs review » Fixed

Just committed #3113476: Fallback when request is not available on the stack in Time service, so now that replacement is feasible, moving back to fixed.

mpdonadio’s picture

Updated the change record, https://www.drupal.org/node/2785211

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.