Problem/Motivation

The test fails on PHP 8.1 https://www.drupal.org/pift-ci-job/2212609

Steps to reproduce

phpstorm also reports that $finished could be undefined

Proposed resolution

fix code

Remaining tasks

review,commit

User interface changes

API changes

Data model changes

Release notes snippet

Comments

andypost created an issue. See original summary.

andypost’s picture

Status: Active » Needs review
StatusFileSize
new613 bytes

workaround patch

andypost’s picture

Locally can't reproduce it, probably it happens only on very fast machines

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.

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.

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new143 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

ranjith_kumar_k_u’s picture

StatusFileSize
new575 bytes

Re-rolled #2

error: patch failed: core/includes/batch.inc:352
error: core/includes/batch.inc: patch does not apply

ricardofaria’s picture

StatusFileSize
new39.17 KB

#4 is working for me on 10.1.x-dev
SS attached.

kunalgautam’s picture

StatusFileSize
new1.06 KB

Phpstan issues fixed

andypost’s picture

Status: Needs work » Needs review
StatusFileSize
new1.13 KB

Fixed

  1. +++ b/core/includes/batch.inc
    @@ -32,6 +32,7 @@
    +  $response = [];
    

    FALSE is default value, looking at usage

  2. +++ b/core/includes/batch.inc
    @@ -249,6 +250,7 @@ function _batch_progress_page() {
    +  $old_set = [];
    

    no need just fix usage

andypost’s picture

Issue tags: +PHPStan
StatusFileSize
new617 bytes
new1.81 KB

Fix CS

spokje’s picture

Issue tags: -PHPStan +PHPStan-1
andypost’s picture

Title: FIx possibly undefined $finished in _batch_process() » Fix possibly undefined $finished in _batch_process()
Related issues: +#3190406: Update PHPStan to level 1

thanks, baseline was added in #3190406: Update PHPStan to level 1

spokje’s picture

No worries, just doing the easy stuff.
You're the one doing the actual hard work... :)

spokje’s picture

Status: Needs review » Reviewed & tested by the community

- Code changes make sense
- TestBot is mostly green, failures seem "normal" random ones.

Seems like a nice PHPStan baseline clean-up, RTBC for me.

  • catch committed 0bbf0739 on 10.1.x
    Issue #3245252 by andypost, ranjith_kumar_k_u, Spokje: Fix possibly...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.1.x, thanks!

Status: Fixed » Closed (fixed)

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