Error: Cannot use a scalar value as an array in tablefield_required_process_tablefield()

Created on 10 March 2023, about 2 years ago

Problem/Motivation

After the latest Drupal core and tablefield module updates, I can see this error when I try to add new node.

The website encountered an unexpected error. Please try again later.
Error: Cannot use a scalar value as an array in tablefield_required_process_tablefield() (line 141 of modules/contrib/tablefield/tablefield_required/tablefield_required.module).
tablefield_required_process_tablefield(Array, Object, Array)
call_user_func_array('tablefield_required_process_tablefield', Array) (Line: 1010)
Drupal\Core\Form\FormBuilder->doBuildForm('node_cennik_form', Array, Object) (Line: 1073)
Drupal\Core\Form\FormBuilder->doBuildForm('node_cennik_form', Array, Object) (Line: 1073)
Drupal\Core\Form\FormBuilder->doBuildForm('node_cennik_form', Array, Object) (Line: 1073)
Drupal\Core\Form\FormBuilder->doBuildForm('node_cennik_form', Array, Object) (Line: 577)
Drupal\Core\Form\FormBuilder->processForm('node_cennik_form', Array, Object) (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber
{closure}() (Line: 580)
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} 

After debugging, I can see that one value of $col is int. I have 14 $rows and I can see that one value is 14 instead of array and I don't know why? To prevent this error, I suggest to check this var is array.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ต๐Ÿ‡ฑPoland lamp5 Rzeszow

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024