- Issue created by @arif.zisu
- 🇵🇱Poland robert.kandzia
@arif.zisu Can you share a full backtrace for the above error?
- 🇵🇱Poland robert.kandzia
When an error occurs, the getSections() method returns an array containing arrays.
In my case, the getSections() method should return an array of objects of the Drupal\layout_builder\Section type. That's why the toRenderArray() method is missing.
In the code, I found a place where the array with arrays is replaced with an array with the Section object.
It is located in the src/Entity/LayoutBuilderStorage.php file in the mapFromStorageRecords() method.
$sections = array_map([Section::class, 'fromArray'], $sections);
But I haven't found a reason yet why it sometimes doesn't change. I suspect the cache.
I prepared a patch to force reprocessing into arrays of objects.