Follow-up to #3193835: Warning: Illegal string offset 'messages' in Drupal\upgrade_status\ScanResultFormatter->formatResult(): I just updated to 3.2, and while that other error was fixed, there actually appear to be a few different string offset errors now. These actually may have been present before as well and I just thought the same message was being duplicated over and over since I was getting a wall of errors thrown at me. Here's what I get when I scan voting_api:

Warning: Illegal string offset 'message' in Drupal\upgrade_status\DeprecationAnalyzer->analyze() (line 421 of modules/contrib/upgrade_status/src/DeprecationAnalyzer.php).

Drupal\upgrade_status\DeprecationAnalyzer->analyze(Object) (Line: 138)
Drupal\upgrade_status\Controller\ScanResultController->analyze('votingapi')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Warning: Illegal string offset 'message' in Drupal\upgrade_status\DeprecationAnalyzer->analyze() (line 422 of modules/contrib/upgrade_status/src/DeprecationAnalyzer.php).
Drupal\upgrade_status\DeprecationAnalyzer->analyze(Object) (Line: 138)
Drupal\upgrade_status\Controller\ScanResultController->analyze('votingapi')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Warning: Illegal string offset 'upgrade_status_category' in Drupal\upgrade_status\DeprecationAnalyzer->analyze() (line 423 of modules/contrib/upgrade_status/src/DeprecationAnalyzer.php).

Drupal\upgrade_status\DeprecationAnalyzer->analyze(Object) (Line: 138)
Drupal\upgrade_status\Controller\ScanResultController->analyze('votingapi')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
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

mrweiner created an issue. See original summary.

justcaldwell’s picture

Same here. In addition to the three warnings above, I also get a 'Trying to access array...' notice for each module I'm scanning:

Notice: Trying to access array offset on value of type int in Drupal\upgrade_status\DeprecationAnalyzer->analyze() (line 421 of modules/contrib/upgrade_status/src/DeprecationAnalyzer.php).
Drupal\upgrade_status\DeprecationAnalyzer->analyze(Object) (Line: 138)
Drupal\upgrade_status\Controller\ScanResultController->analyze('upload_replace')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
mrweiner’s picture

Issue summary: View changes
gábor hojtsy’s picture

Oh well. I wonder why does this not happen for me. @justcaldwell or @mrweiner: can you debug what is the data structure that the code is failing on?

For Notice: Trying to access array offset on value of type int in Drupal\upgrade_status\DeprecationAnalyzer->analyze() (line 421 of modules/contrib/upgrade_status/src/DeprecationAnalyzer.php). for example is about [$message, $category] = $this->categorizeMessage($error['message'], $extension);, so $error will be an integer here. How?

gábor hojtsy’s picture

Status: Active » Needs review

Continued discussing with @mrweiner on slack yesterday and turns out the fix in #3193835: Warning: Illegal string offset 'messages' in Drupal\upgrade_status\ScanResultFormatter->formatResult() was still not quite right. One more level of array nesting is required to replicate the result structure expected everywhere.

Mind you this will only move you closer to seeing the actual PHPStan error message, so it will still not run perfect, but at least you'll get to see what's PHPStan's problem. But that will work gracefully at least. Fingers crossed :D

gábor hojtsy’s picture

  • Gábor Hojtsy committed 3d82140 on 8.x-3.x
    Issue #3195223 by Gábor Hojtsy, mrweiner, justcaldwell: Multiple string...
gábor hojtsy’s picture

Status: Needs review » Fixed

Fast tracking this in in the interest of Drupal Global Contribution Weekend support. Fingers crossed this is the final good fix now :D

Status: Fixed » Closed (fixed)

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