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)
Comments
Comment #2
justcaldwellSame here. In addition to the three warnings above, I also get a 'Trying to access array...' notice for each module I'm scanning:
Comment #3
mrweiner commentedComment #4
gábor hojtsyOh 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$errorwill be an integer here. How?Comment #6
gábor hojtsyContinued 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
Comment #7
gábor hojtsyComment #9
gábor hojtsyFast tracking this in in the interest of Drupal Global Contribution Weekend support. Fingers crossed this is the final good fix now :D