When using the "Paragraphs table" formatter with the PHP 8.1 version, the following error appears in the logs:
Deprecated function: Automatic conversion of false to array is deprecated
Drupal\paragraphs_table\Controller\AjaxController->getResults()
(line 184 of /(...)/web/modules/contrib/paragraphs_table/src/Controller/AjaxController.php)
It's a PHP8.1 + Drupal 9.4.5 installation
As I understand this problem is being caused by the variable, $data
, which is intended to be an array being created as FALSE, so that if it is not filled it returns FALSE.
My proposal is to create the variable $data
as an empty array and validate if the array is empty or not at the time of return. If empty, returns FALSE. If the array contains data returns the variable $data
.
$data = [];
foreach ($entities as $delta => $entity) {
$table_entity = $this->renderBuild->build($entity);
$objectData = new \stdClass();
foreach ($components as $field_name => $field) {
...
$data[$delta] = $objectData;
}
return count($data) ? $data : FALSE;
None.
None.
None.
Node.
Closed: duplicate
1.8
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.