We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c036782 commit 121609aCopy full SHA for 121609a
1 file changed
src/Plugin/GraphQL/DataProducer/Menu/MenuLink/MenuLinkAttribute.php
@@ -36,7 +36,13 @@ class MenuLinkAttribute extends DataProducerPluginBase {
36
*/
37
public function resolve(MenuLinkInterface $link, $attribute) {
38
$options = $link->getOptions();
39
- return NestedArray::getValue($options, ['attributes', $attribute]);
+ // Certain attributes like class can be arrays. Check for that and implode them.
40
+ $attributeValue = NestedArray::getValue($options, ['attributes', $attribute]);
41
+ if (is_array($attributeValue)) {
42
+ return implode(" ", $attributeValue);
43
+ } else {
44
+ return $attributeValue;
45
+ }
46
}
47
48
0 commit comments