Commit c1f7ffae authored by xjm's avatar xjm

Issue #3033404 by phenaproxima, seanB: Views DisplayLink area plugin tries to...

Issue #3033404 by phenaproxima, seanB: Views DisplayLink area plugin tries to use non-existent theme hook
parent 589519e5
......@@ -196,12 +196,8 @@ public function render($empty = FALSE) {
$classes[] = 'is-active';
}
// By default, this element sets #theme so that the 'link' theme hook is
// used for rendering, with the 'views_display_link' suffix so that themes
// can override this specifically without overriding all link theming.
return [
'#type' => 'link',
'#theme' => 'link__views_display_link',
'#title' => $this->options['label'],
'#url' => $this->view->getUrl($this->view->args, $this->options['display_id'])->setOptions(['query' => $query]),
'#options' => [
......
......@@ -6,10 +6,13 @@
use Drupal\Core\EventSubscriber\MainContentViewSubscriber;
use Drupal\Core\Form\FormBuilderInterface;
use Drupal\Core\Form\FormState;
use Drupal\Core\Logger\RfcLogLevel;
use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
use Drupal\views\ViewExecutable;
use Drupal\views\Views;
use Prophecy\Argument;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
......@@ -105,6 +108,19 @@ protected function setUp($import_test_views = TRUE) {
];
$default->setOption('header', $display_links);
$view->save();
// Ensure that the theme system does not log any errors about missing theme
// hooks when rendering the link.
$logger = $this->prophesize(LoggerInterface::class);
$logger->log(
RfcLogLevel::WARNING,
'Theme hook %hook not found.',
Argument::withEntry('%hook', 'link')
)->shouldNotBeCalled();
$this->container->get('logger.factory')
->get('theme')
->addLogger($logger->reveal());
}
/**
......
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