Not sure of how to reproduce this, but I'm seeing Warning: Illegal string offset 'messages' in Drupal\upgrade_status\ScanResultFormatter->formatResult() (line 164 of /var/www/html/web/modules/contrib/upgrade_status/src/ScanResultFormatter.php) crop up. Attaching a patch to drop that foreach inside of an isset.

Comments

mrweiner created an issue. See original summary.

mrweiner’s picture

Status: Active » Needs review
StatusFileSize
new8.94 KB
gábor hojtsy’s picture

StatusFileSize
new555 bytes

I also don't know under which conditions would that array be empty, but I added a similar check in https://git.drupalcode.org/project/upgrade_status/-/commit/727d8fa0c2f32...

That said, I would not indent the whole code here, that makes it unreadable. I'd rather skip it.

gábor hojtsy’s picture

StatusFileSize
new956 bytes

Same problem exists with producing ASCII output. People at #3193120: Shows '1 problem' after rescan following info.yml file fix, but no actual problem displayed believe they ran into the same bug but with slightly different sympthoms. Do you also experience the problem with the summary table?

gábor hojtsy’s picture

StatusFileSize
new4.82 KB

Actually we need to do the opposite. Rather than fixing use of incorrect data, fix the incorrect data. I found the source in the PHPStan fail handling. Duh. That means we can get rid of the existing workaround to the broken data rather than respecting the broken data. That said, we also need an update function to remove the broken data and make people gather that data again.

gábor hojtsy’s picture

Crediting @theterencechan who uncovered the underlying issue in #3193120: Shows '1 problem' after rescan following info.yml file fix, but no actual problem displayed and @joachim who opened that issue.

gábor hojtsy’s picture

Fix indentation.

Also I've been thinking about not dropping the whole state altogether but rather filter out the incorrect results only (or even better fix them in the update), but then I also found #3194003: Second, third, etc. twig issues overwrite the previous twig issue found which would need a rescan, so it feels best to drop the whole scan state and require rescanning.

gábor hojtsy’s picture

StatusFileSize
new4.97 KB

gábor hojtsy’s picture

Crediting folks from #3178702: PHPStan Failure Message Is Incorrectly Logged When The Output Is Empty which appears to be the very same issue.

  • Gábor Hojtsy committed e604845 on 8.x-3.x
    Issue #3193835 by Gábor Hojtsy, mrweiner, joachim, theterencechan,...
gábor hojtsy’s picture

Status: Needs review » Fixed

I'd like to do what it takes to get out a release soon enough for the global contribution weekend in a couple days, so given nothing against, committed this. Thanks all! Please test with -dev and report any new issues found.

mrweiner’s picture

Thanks, appreciate the work!

Status: Fixed » Closed (fixed)

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