Problem/Motivation

There's few outdated mentions of deprecated constant REQUEST_TIME left after #2902895: [meta][no patch] Replace uses of REQUEST_TIME and time() with time service

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

Issue fork drupal-3422973

Command icon 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:

Comments

andypost created an issue. See original summary.

andypost’s picture

Issue tags: +Novice

acbramley made their first commit to this issue’s fork.

acbramley’s picture

Status: Active » Needs review

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.

dww’s picture

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. Needs subsystem maintainer review. 😂

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

acbramley’s picture

@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.

dww’s picture

Issue tags: -Novice

Yeah, you're probably right. Let's remove the tag, then. 😅

dww’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for resolving the thread. RTBC. Saving credits.

catch’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

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...

  • catch committed 985b057b on 11.x
    Issue #3422973 by acbramley, dww, andypost: Replace remaining mentions...
catch’s picture

andypost’s picture

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.
catch’s picture

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

andypost’s picture

Sorry, yes, I missed to pull

Status: Fixed » Closed (fixed)

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