Warning: Array to string conversion in Drupal\Component\Utility\Html::load()

Created on 12 July 2023, over 1 year ago

Problem/Motivation

Recently I have updated Drupal version 8.7.5 to 9.5.9 .and also updated Rest Block Layout module with latest version 2.0.0 . So after api call http://www.xxx.com/block-layout?_format=json&path=/home .However I am now getting a series of Notices on every page regarding Array to String conversions. I've included the whole error below. Any insight on this will be greatly appreciated.

Warning: Array to string conversion in Drupal\Component\Utility\Html::load() (line 285 of C:\xampp\htdocs\projects\xxx\core\lib\Drupal\Component\Utility\Html.php)
#0 C:\xampp\htdocs\projects\xxx\core\includes\bootstrap.inc(347): _drupal_error_handler_real(2, 'Array to string...', 'C:\\xampp\\htdocs...', 285)
#1 [internal function]: _drupal_error_handler(2, 'Array to string...', 'C:\\xampp\\htdocs...', 285)
#2 C:\xampp\htdocs\projects\xxx\core\lib\Drupal\Component\Utility\Html.php(285): strtr('<!DOCTYPE html ...', Array)
#3 C:\xampp\htdocs\projects\xxx\core\lib\Drupal\Component\Utility\Html.php(467): Drupal\Component\Utility\Html::load(Array)
#4 C:\xampp\htdocs\projects\xxx\modules\custom\rest_absolute_urls\src\Normalizer\StringDataNormalizer.php(52): Drupal\Component\Utility\Html::transformRootRelativeUrlsToAbsolute(Array, 'http://www.loca...')
#5 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(153): Drupal\rest_absolute_urls\Normalizer\StringDataNormalizer->normalize(Object(Drupal\metatag\Plugin\DataType\Metatag), 'json', Array)
#6 C:\xampp\htdocs\projects\xxx\core\modules\serialization\src\Normalizer\ComplexDataNormalizer.php(42): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\metatag\Plugin\DataType\Metatag), 'json', Array)
#7 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(153): Drupal\serialization\Normalizer\ComplexDataNormalizer->normalize(Array, 'json', Array)
#8 C:\xampp\htdocs\projects\xxx\core\modules\serialization\src\Normalizer\ListNormalizer.php(29): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\metatag\Plugin\Field\FieldType\MetatagFieldItem), 'json', Array)
#9 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(153): Drupal\serialization\Normalizer\ListNormalizer->normalize(Object(Drupal\metatag\Plugin\Field\FieldType\MetatagFieldItemList), 'json', Array)
#10 C:\xampp\htdocs\projects\xxx\core\modules\serialization\src\Normalizer\ContentEntityNormalizer.php(30): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\metatag\Plugin\Field\FieldType\MetatagFieldItemList), 'json', Array)
#11 C:\xampp\htdocs\projects\xxx\modules\custom\node_normalizer\src\Normalizer\NodeEntityNormalizer.php(37): Drupal\serialization\Normalizer\ContentEntityNormalizer->normalize(Object(Drupal\node\Entity\Node), 'json', Array)
#12 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(153): Drupal\node_normalizer\Normalizer\NodeEntityNormalizer->normalize(Object(Drupal\node\Entity\Node), 'json', Array)
#13 C:\xampp\htdocs\projects\xxx\modules\contrib\rest_block_layout\src\Normalizer\BlockNormalizer.php(65): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\node\Entity\Node), 'json', Array)
#14 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(153): Drupal\rest_block_layout\Normalizer\BlockNormalizer->normalize(Object(Drupal\block\Entity\Block), 'json', Array)
#15 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(167): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\block\Entity\Block), 'json', Array)
#16 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(167): Symfony\Component\Serializer\Serializer->normalize(Array, 'json', Array)
#17 C:\xampp\htdocs\projects\xxx\vendor\symfony\serializer\Serializer.php(126): Symfony\Component\Serializer\Serializer->normalize(Array, 'json', Array)
#18 C:\xampp\htdocs\projects\xxx\core\modules\rest\src\EventSubscriber\ResourceResponseSubscriber.php(160): Symfony\Component\Serializer\Serializer->serialize(Array, 'json', Array)


🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India anisha786

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

Comments & Activities

Production build 0.71.5 2024