Cannot access offset of type string in PHP 8.*

Created on 17 November 2022, about 2 years ago
Updated 22 July 2024, 4 months ago

After PHP update 8.0.19 or 8.1.12 the following pages breaks /admin/content/media

In 7.4.29 it works

On #840 in views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php, $selected_action_data is a string ('views_bulk_operations_delete_entity') so $selected_action_data['action_id'] throws an error

Error message:
TypeError: Cannot access offset of type string on string in Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm->getBulkOptions() (regel 840 van /var/www/corporate/web/modules/contrib/views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php)
#0 /var/www/corporate/web/modules/contrib/views_bulk_operations/src/Plugin/views/field/ViewsBulkOperationsBulkForm.php(568): Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm->getBulkOptions()
#1 /var/www/corporate/web/core/modules/views/src/ViewExecutable.php(1506): Drupal\views_bulk_operations\Plugin\views\field\ViewsBulkOperationsBulkForm->preRender()
#2 /var/www/corporate/web/core/modules/views/src/Plugin/views/display/Page.php(199): Drupal\views\ViewExecutable->render()
#3 /var/www/corporate/web/core/modules/views/src/ViewExecutable.php(1633): Drupal\views\Plugin\views\display\Page->execute()
#4 /var/www/corporate/web/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay()
#5 [internal function]: Drupal\views\Element\View::preRenderViewElement()
#6 /var/www/corporate/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array()
#7 /var/www/corporate/web/core/lib/Drupal/Core/Render/Renderer.php(772): Drupal\Core\Render\Renderer->doTrustedCallback()
#8 /var/www/corporate/web/core/lib/Drupal/Core/Render/Renderer.php(363): Drupal\Core\Render\Renderer->doCallback()
#9 /var/www/corporate/web/core/lib/Drupal/Core/Render/Renderer.php(201): Drupal\Core\Render\Renderer->doRender()
#10 /var/www/corporate/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(241): Drupal\Core\Render\Renderer->render()
#11 /var/www/corporate/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}()
#12 /var/www/corporate/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(242): Drupal\Core\Render\Renderer->executeInRenderContext()
#13 /var/www/corporate/web/core/lib/Drupal/Core/Render/MainContent/HtmlRenderer.php(132): Drupal\Core\Render\MainContent\HtmlRenderer->prepare()
#14 /var/www/corporate/web/core/lib/Drupal/Core/EventSubscriber/MainContentViewSubscriber.php(90): Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse()
#15 [internal function]: Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
#16 /var/www/corporate/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func()
#17 /var/www/corporate/vendor/symfony/http-kernel/HttpKernel.php(174): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#18 /var/www/corporate/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#19 /var/www/corporate/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#20 /var/www/corporate/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#21 /var/www/corporate/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#22 /var/www/corporate/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#23 /var/www/corporate/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#24 /var/www/corporate/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#25 /var/www/corporate/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#26 /var/www/corporate/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle()
#27 /var/www/corporate/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#28 {main}

🐛 Bug report
Status

Closed: works as designed

Version

4.2

Component

Core

Created by

🇳🇱Netherlands Drumanuel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇦🇺Australia pameeela

    I was having the same error but resolved it by deleting and re-adding the field on the view. I think this is what Graber meant by invalid configuration data :)

    So this is probably works as designed?

  • Status changed to Closed: works as designed almost 2 years ago
  • 🇵🇱Poland Graber

    Yes, sorry for being so modest in my comments, resaving / recreating the view config usually helps in such cases, thanks @pameeela!

  • 🇦🇺Australia pasan.gamage

    I've tried #7 but did not work, #3 patch worked for me.
    Drupal 10, VBO 4.2.7
    Thanks

Production build 0.71.5 2024