- Issue created by @nicxvan
I'm creating about a dozen very similar shortcodes and I want to use a custom template for this.
When I set up a render array:
$cacheTags = [
$shortcode,
];
$render = [];
$render[] = [
'#theme' => 'statistics',
'#classes' => $classes,
'#statistic' => $statistic,
'#reference' => $reference,
'#cache' => [
'max-age' => 64000,
'tags' => $cacheTags,
],
];
return $render;
I would expect this to render, instead I receive this error:
Warning: Array to string conversion in Drupal\shortcode\ShortcodeService->processTag() (line 449 of modules/contrib/shortcode/src/ShortcodeService.php).
and nothing renders.
Active
2.0
Miscellaneous