array_key_exists()

Created on 15 November 2024, about 1 month ago

Problem/Motivation

This is keeping Cron from running.
array_key_exists(): Argument #2 ($array) must be of type array, string given in array_key_exists()

Message TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in array_key_exists() (line 175 of /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/modules/contrib/tablefield/src/Plugin/Field/FieldType/TablefieldItem.php)

#0 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/modules/contrib/tablefield/src/Plugin/Field/FieldType/TablefieldItem.php(175): array_key_exists()
#1 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php(216): Drupal\tablefield\Plugin\Field\FieldType\TablefieldItem->setValue()
#2 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldTypePluginManager.php(100): Drupal\Core\TypedData\TypedDataManager->getPropertyInstance()
#3 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldItemList.php(41): Drupal\Core\Field\FieldTypePluginManager->createFieldItem()
#4 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php(71): Drupal\Core\Field\FieldItemList->createItem()
#5 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldItemList.php(107): Drupal\Core\TypedData\Plugin\DataType\ItemList->setValue()
#6 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php(114): Drupal\Core\Field\FieldItemList->setValue()
#7 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1698): Drupal\Core\TypedData\TypedDataManager->create()
#8 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(557): Drupal\Core\Entity\Sql\SqlContentEntityStorage->readFieldItemsToPurge()
#9 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/field/field.purge.inc(83): Drupal\Core\Entity\ContentEntityStorageBase->purgeFieldData()
#10 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/field/field.module(170): field_purge_batch()
#11 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(337): field_cron()
#12 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Cron->Drupal\Core\{closure}()
#13 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(345): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#14 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(159): Drupal\Core\Cron->invokeCronHandlers()
#15 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#16 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
#17 [internal function]: Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate()
#18 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#19 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#20 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(66): Symfony\Component\HttpKernel\HttpKernel->terminate()
#21 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
#22 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/index.php(22): Drupal\Core\DrupalKernel->terminate()
#23 {main}

Steps to reproduce

I've tried this in 2.4 and 2.5rc1. When running cron I get a WSOD

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Component

Code

Created by

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

Comments & Activities

  • Issue created by @scottriggle
  • 🇮🇳India priti197

    Created a patch to fix this issue.

  • Patch appreciated. I'm getting this on running Cron:

    TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in array_key_exists() (line 175 of /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/modules/contrib/tablefield/src/Plugin/Field/FieldType/TablefieldItem.php)

    #0 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/modules/contrib/tablefield/src/Plugin/Field/FieldType/TablefieldItem.php(175): array_key_exists()
    #1 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php(216): Drupal\tablefield\Plugin\Field\FieldType\TablefieldItem->setValue()
    #2 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldTypePluginManager.php(100): Drupal\Core\TypedData\TypedDataManager->getPropertyInstance()
    #3 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldItemList.php(41): Drupal\Core\Field\FieldTypePluginManager->createFieldItem()
    #4 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php(71): Drupal\Core\Field\FieldItemList->createItem()
    #5 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldItemList.php(107): Drupal\Core\TypedData\Plugin\DataType\ItemList->setValue()
    #6 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php(114): Drupal\Core\Field\FieldItemList->setValue()
    #7 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1698): Drupal\Core\TypedData\TypedDataManager->create()
    #8 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(557): Drupal\Core\Entity\Sql\SqlContentEntityStorage->readFieldItemsToPurge()
    #9 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/field/field.purge.inc(83): Drupal\Core\Entity\ContentEntityStorageBase->purgeFieldData()
    #10 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/field/field.module(170): field_purge_batch()
    #11 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(337): field_cron()
    #12 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Cron->Drupal\Core\{closure}()
    #13 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(345): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #14 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(159): Drupal\Core\Cron->invokeCronHandlers()
    #15 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
    #16 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
    #17 [internal function]: Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate()
    #18 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
    #19 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #20 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(66): Symfony\Component\HttpKernel\HttpKernel->terminate()
    #21 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
    #22 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/index.php(22): Drupal\Core\DrupalKernel->terminate()
    #23 {main}

  • 🇺🇸United States erutan

    FWIW I'm able to run cron with this module enabled on 10.3.10. The only patch I have now is the copy/paste one.

  • 🇺🇸United States erutan

    This looks like a duplicate of https://www.drupal.org/project/tablefield/issues/3321023 🐛 Error when deleting a tablefield Needs review , does the patch in that issue fix this for you?

  • I may have tried -2 of https://www.drupal.org/project/tablefield/issues/3321023 🐛 Error when deleting a tablefield Needs review
    apon trying https://www.drupal.org/files/issues/2023-01-11/3321023-5.patch I'm still getting white screen on running cron.

    TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in array_key_exists() (line 175 of /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/modules/contrib/tablefield/src/Plugin/Field/FieldType/TablefieldItem.php)

    #0 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/modules/contrib/tablefield/src/Plugin/Field/FieldType/TablefieldItem.php(175): array_key_exists()
    #1 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php(216): Drupal\tablefield\Plugin\Field\FieldType\TablefieldItem->setValue()
    #2 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldTypePluginManager.php(100): Drupal\Core\TypedData\TypedDataManager->getPropertyInstance()
    #3 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldItemList.php(41): Drupal\Core\Field\FieldTypePluginManager->createFieldItem()
    #4 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php(71): Drupal\Core\Field\FieldItemList->createItem()
    #5 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Field/FieldItemList.php(107): Drupal\Core\TypedData\Plugin\DataType\ItemList->setValue()
    #6 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/TypedData/TypedDataManager.php(114): Drupal\Core\Field\FieldItemList->setValue()
    #7 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(1698): Drupal\Core\TypedData\TypedDataManager->create()
    #8 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(557): Drupal\Core\Entity\Sql\SqlContentEntityStorage->readFieldItemsToPurge()
    #9 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/field/field.purge.inc(83): Drupal\Core\Entity\ContentEntityStorageBase->purgeFieldData()
    #10 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/field/field.module(170): field_purge_batch()
    #11 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(337): field_cron()
    #12 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Cron->Drupal\Core\{closure}()
    #13 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(345): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
    #14 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/Cron.php(159): Drupal\Core\Cron->invokeCronHandlers()
    #15 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
    #16 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run()
    #17 [internal function]: Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate()
    #18 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
    #19 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
    #20 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(66): Symfony\Component\HttpKernel\HttpKernel->terminate()
    #21 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
    #22 /var/www/vhosts/w5.studentcenter.gatech.edu/httpdocs/web/index.php(22): Drupal\Core\DrupalKernel->terminate()
    #23 {main}

Production build 0.71.5 2024