Replace remaining mentions of REQUEST_TIME in comments

Created on 21 February 2024, 9 months ago
Updated 13 March 2024, 8 months ago

Problem/Motivation

There's few outdated mentions of deprecated constant REQUEST_TIME left after πŸ“Œ [meta][no patch] Replace uses of REQUEST_TIME and time() with time service Active

Steps to reproduce

$ git grep REQUEST_TIME

core/lib/Drupal/Component/Datetime/TimeInterface.php:23:   * $request_time = REQUEST_TIME;

core/lib/Drupal/Core/Asset/JsCollectionRenderer.php:79:    // URL changed. Files that should not be cached get REQUEST_TIME as

core/lib/Drupal/Core/Entity/entity.api.php:575: *   ->condition('changed', REQUEST_TIME - $age, '<')
core/lib/Drupal/Core/Entity/entity.api.php:1179:      'created' => REQUEST_TIME,
core/lib/Drupal/Core/Entity/entity.api.php:1180:      'updated' => REQUEST_TIME,
core/lib/Drupal/Core/Entity/entity.api.php:1202:      'created' => REQUEST_TIME,
core/lib/Drupal/Core/Entity/entity.api.php:1203:      'updated' => REQUEST_TIME,
core/lib/Drupal/Core/Entity/entity.api.php:1225:      'updated' => REQUEST_TIME,
core/lib/Drupal/Core/Entity/entity.api.php:1249:      'updated' => REQUEST_TIME,

core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php:45:    // Set the maximum age to a number smaller than REQUEST_TIME - $filectime.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
DocumentationΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡«πŸ‡·France andypost

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @andypost
  • First commit to issue fork.
  • Status changed to Needs review 9 months ago
  • πŸ‡¦πŸ‡ΊAustralia acbramley

    Replaced all but one with the API equiv.

    The mention in TimeInterface was removed entirely because the comment is talking about replacing things with the API call.

  • Pipeline finished with Success
    9 months ago
    Total: 606s
    #101086
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Whoops, @acbramley isn't a novice, but I think they did the work before @andypost tagged this issue as such. πŸ˜…

    MR mostly looks great. Agreed with removing the line entirely in TimeInterface. Left a suggestion for a tiny nit in the Kernel test from Update module. . πŸ˜‚

    Title and summary are clear. This is comment-only, so no tests needed. MR pipeline is green (as expected). IMHO, this is RTBC with my suggestion applied, and probably even without it. 😊

    Thanks,
    -Derek

  • πŸ‡¦πŸ‡ΊAustralia acbramley

    @dww honestly I don't think this is a Novice issue. As you have seen, it takes knowledge/investigation on what each of those comments are describing. For example, noticing the TimeInterface example could be removed entirely.

    Since I've been close to all these issues recently I thought it was easier if I just did it.

  • πŸ‡ΊπŸ‡ΈUnited States dww

    Yeah, you're probably right. Let's remove the tag, then. πŸ˜…

  • Status changed to RTBC 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States dww

    Thanks for resolving the thread. RTBC. Saving credits.

  • πŸ‡¬πŸ‡§United Kingdom catch

    At some point we should redo the hook_enitty_update()/insert() hook documentation to not have documentation examples that pre-date the existence of field API and do direct database queries. But all the changes look good.

    Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!

    • catch β†’ committed 9cd54865 on 10.3.x
      Issue #3422973 by acbramley, dww, andypost: Replace remaining mentions...
  • Status changed to Fixed 9 months ago
    • catch β†’ committed 985b057b on 11.x
      Issue #3422973 by acbramley, dww, andypost: Replace remaining mentions...
  • πŸ‡¬πŸ‡§United Kingdom catch
  • πŸ‡«πŸ‡·France andypost

    Needs follow-up for

    $ git grep ' REQUEST_TIME'
    core/lib/Drupal/Component/Datetime/TimeInterface.php:23:   * $request_time = REQUEST_TIME;
    core/lib/Drupal/Core/Asset/JsCollectionRenderer.php:79:    // URL changed. Files that should not be cached get REQUEST_TIME as
    ...
    core/lib/Drupal/Core/Entity/entity.api.php:575: *   ->condition('changed', REQUEST_TIME - $age, '<')
    core/lib/Drupal/Core/Entity/entity.api.php:1179:      'created' => REQUEST_TIME,
    core/lib/Drupal/Core/Entity/entity.api.php:1180:      'updated' => REQUEST_TIME,
    core/lib/Drupal/Core/Entity/entity.api.php:1202:      'created' => REQUEST_TIME,
    core/lib/Drupal/Core/Entity/entity.api.php:1203:      'updated' => REQUEST_TIME,
    core/lib/Drupal/Core/Entity/entity.api.php:1225:      'updated' => REQUEST_TIME,
    core/lib/Drupal/Core/Entity/entity.api.php:1249:      'updated' => REQUEST_TIME,
    ...
    core/modules/update/tests/src/Kernel/UpdateDeleteFileIfStaleTest.php:45:    // Set the maximum age to a number smaller than REQUEST_TIME - $filectime.
    
  • πŸ‡¬πŸ‡§United Kingdom catch

    @andypost you might be missing a git pull? Those are the ones fixed in this issue.

  • πŸ‡«πŸ‡·France andypost

    Sorry, yes, I missed to pull

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

Production build 0.71.5 2024