Commit ec029471 authored by catch's avatar catch

Issue #2828680 by raman.b, bandanasharma, mogtofu33, drclaw, damontgomery,...

Issue #2828680 by raman.b, bandanasharma, mogtofu33, drclaw, damontgomery, tanubansal, paulocs, amietpatial, Chi, borisson_: Missing ul wrapper on forum local action links

(cherry picked from commit 290d4049)
parent 8b1bfc8f
......@@ -294,7 +294,6 @@ protected function buildActionLinks($vid, TermInterface $forum_term = NULL) {
if ($this->nodeAccess->createAccess($type)) {
$node_type = $this->nodeTypeStorage->load($type);
$links[$type] = [
'#attributes' => ['class' => ['action-links']],
'#theme' => 'menu_local_action',
'#link' => [
'title' => $this->t('Add new @node_type', [
......@@ -323,15 +322,26 @@ protected function buildActionLinks($vid, TermInterface $forum_term = NULL) {
// Anonymous user does not have access to create new topics.
else {
$links['login'] = [
'#attributes' => ['class' => ['action-links']],
'#theme' => 'menu_local_action',
'#link' => [
'title' => $this->t('Log in to post new content in the forum.'),
'url' => Url::fromRoute('user.login', [], ['query' => $this->getDestinationArray()]),
],
// Without this workaround, the action links will be rendered as <li>
// with no wrapping <ul> element.
// @todo Find a better way for this in https://www.drupal.org/node/3181052.
'#prefix' => '<ul class="action-links">',
'#suffix' => '</ul>',
];
}
}
else {
// Without this workaround, the action links will be rendered as <li> with
// no wrapping <ul> element.
// @todo Find a better way for this in https://www.drupal.org/node/3181052.
$links['#prefix'] = '<ul class="action-links">';
$links['#suffix'] = '</ul>';
}
return $links;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment