Skip to content
Snippets Groups Projects
Commit 7333d64f authored by Wolfgang Ziegler's avatar Wolfgang Ziegler
Browse files

Issue #3060570: Warning when rendering thunder image paragraphs: count():...

Issue #3060570: Warning when rendering thunder image paragraphs: count(): Parameter must be an array or an object that implements Countable.
parent f7fd261b
No related branches found
Tags 7.x-1.0-rc1
No related merge requests found
......@@ -194,8 +194,13 @@ class CustomElement implements CacheableDependencyInterface {
}
// Do not add a default slot tag if this is the only content.
if (count($content) == 1 && isset($slots['default']) && count($slots['default']['attributes']) == 1 && !in_array($slots['default']['tag'], static::$noEndTags)) {
$content = $slots['default']['content'];
if (count($content) == 1 && isset($slots['default']) && !in_array($slots['default']['tag'], static::$noEndTags)) {
// Ensure no other attribute besides 'slot' has been added.
// If so, we can forward the slot content as content without slot tag.
if (array_keys($slots['default']['attributes']->storage()) == ['slot']) {
$content = $slots['default']['content'];
}
}
$this->setSlot($key, $content, $nestedElement->getPrefixedTag(), $nestedElement->getAttributes());
// Bubble up cache metadata.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment