Same problem.
Error (0): Cannot use object of type Sitecake\Content\ElementList as array in [[SITE]/sitecake/2.4.8/src/Sitecake/Content/PageRenderAwareTrait.php, line 127]
Here is a fragment of code:
// Check if meta tag already exist
$metaExists = false;
$existingAttributes = [];
$metaTags = $page->query(‘meta[name="’ . $name . ‘"]’);
if ($metaTags->count() > 0) {
/* @var Element $meta */
$meta = $metaTags[0];
$metaExists = true;
// Remove all existing attributes except ‘name’ attribute
$existingAttributes = $meta->getAttributes();
foreach ($existingAttributes as $attr => $value) {
if ($attr !== ‘name’) {
$meta->removeAttribute($attr);
}
}
// set content attribute
$meta->setAttribute(‘content’, $content);
} else {
$meta = new Meta($name, $content);
}
Error in line 127:
$meta = $metaTags[0];
Any solution?