Problem/Motivation

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3112290-02.patch17.79 KBmpdonadio

Issue fork drupal-3112290

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

mpdonadio created an issue. See original summary.

mpdonadio’s picture

Status: Active » Needs review
StatusFileSize
new17.79 KB

Took the patch from 2902895-43.patch

- Isolated just the procedural code changes (well, I tried)

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

kristen pol’s picture

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

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

mondrake’s picture

Version: 9.4.x-dev » 10.0.x-dev
Assigned: mpdonadio » mondrake
Issue tags: +PHPStan-0

Rerolling and retargeting to D10. Curious to see impact on PHPStan's baseline.

mondrake’s picture

Assigned: mondrake » Unassigned
andypost’s picture

Status: Needs review » Needs work
Issue tags: +ContributionWeekend2022

There's many places when new service got a call inside of loops, please beware it as this replacement could affect performance a lot calling \Drupal::time() instead of using constant (within request)

andypost’s picture

Version: 10.0.x-dev » 9.4.x-dev

I bet it should be targeted to 9.4

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

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mondrake’s picture

Version: 9.5.x-dev » 10.0.x-dev
Status: Needs work » Needs review
daffie’s picture

Status: Needs review » Needs work

One thread open on the MR.

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

spokje’s picture

Title: Replace REQUEST_TIME in procedural code » Replace REQUEST_TIME in procedural code
Status: Needs work » Needs review
daffie’s picture

Status: Needs review » Needs work

Commented on the MR.

spokje’s picture

Assigned: Unassigned » spokje

spokje’s picture

Status: Needs work » Needs review

Thanks @daffie for the review.

Addressed all 3 threads.

Also opened a 9.5.x MR, where the only difference with the 10.0.x MR are the changes in core/modules/aggregator/aggregator.module, which has been removed from 10.0.x.

spokje’s picture

Assigned: spokje » Unassigned
daffie’s picture

Status: Needs review » Reviewed & tested by the community

The code changes for both MR's look good to me.
All my points have been addressed.
For me it is RTBC.

spokje’s picture

Broken HEAD on 10.0.x currently.

spokje’s picture

Right, back in the land of the Green TestBot once more.

mallezie’s picture

In #3282315: Update phpstan/phpstan and mglaman/phpstan-drupal to latest versions there was some discussion on the changes in comment and history module file (same for aggregator.module in 9.5 MR). Wether doing this

- define('HISTORY_READ_LIMIT', REQUEST_TIME - 30 * 24 * 60 * 60);
+ define('HISTORY_READ_LIMIT', \Drupal::time()->getRequestTime() - 30 * 24 * 60 * 60);

would be a good idea.
Comments: https://www.drupal.org/project/drupal/issues/3282315#comment-14542184
https://www.drupal.org/project/drupal/issues/3282315#comment-14542319

#2006632: Make HISTORY_READ_LIMIT configurable would solve those in a better way. But not sure if that last one would be a D10 blocker (for removing the deprecated usage).

Not putting back on that one, just noting down here.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

I think the solutions here to call \Drupal::time() in comment.module and history.module is not correct. If you look at when module code is loaded in the Drupal kernel. It does:

    // Load all enabled modules.
    $this->container->get('module_handler')->loadAll();

    // Register stream wrappers.
    $this->container->get('stream_wrapper_manager')->register();

    // Initialize legacy request globals.
    $this->initializeRequestGlobals($request);

    // Put the request on the stack.
    $this->container->get('request_stack')->push($request);

So we're pushing the request onto the request stack after this. I think the better solution is the one in #3282315: Update phpstan/phpstan and mglaman/phpstan-drupal to latest versions - I think what we should do here is update this to the use the same solution and also link to a @todo to remove these constants. They are not constant and should be implemented differently. The issue to link to is #2006632: Make HISTORY_READ_LIMIT configurable.

spokje’s picture

spokje’s picture

Assigned: spokje » Unassigned
Status: Needs work » Needs review
mondrake’s picture

Status: Needs review » Needs work
spokje’s picture

Status: Needs work » Needs review
mondrake’s picture

Status: Needs review » Reviewed & tested by the community

@alexpott input was addressed AFAICS, back to RTBC

alexpott’s picture

Version: 10.0.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 433f2ae0fd to 10.1.x and 55bf7eed54 to 10.0.x. Thanks!
Committed a15d0ef and pushed to 9.5.x. Thanks!

  • alexpott committed 433f2ae on 10.1.x
    Issue #3112290 by Spokje, mondrake, mpdonadio, daffie, andypost, Kristen...

  • alexpott committed 55bf7ee on 10.0.x
    Issue #3112290 by Spokje, mondrake, mpdonadio, daffie, andypost, Kristen...

  • alexpott committed a15d0ef on 9.5.x
    Issue #3112290 by Spokje, mondrake, mpdonadio, daffie, andypost, Kristen...

Status: Fixed » Closed (fixed)

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