Commit 078f09a5 authored by alexpott's avatar alexpott

Issue #2332989 by Cottser: Fixed Twig trans tag debug is still hooked up to Settings.

parent 973fd26d
...@@ -83,7 +83,7 @@ public function compile(\Twig_Compiler $compiler) { ...@@ -83,7 +83,7 @@ public function compile(\Twig_Compiler $compiler) {
$compiler->raw(')'); $compiler->raw(')');
// Append translation debug markup, if necessary. // Append translation debug markup, if necessary.
if (Settings::get('twig_debug', FALSE)) { if ($compiler->getEnvironment()->isDebug()) {
$compiler->raw(" . '\n<!-- TRANSLATION: "); $compiler->raw(" . '\n<!-- TRANSLATION: ");
$compiler->subcompile($singular); $compiler->subcompile($singular);
if (!empty($plural)) { if (!empty($plural)) {
......
...@@ -162,13 +162,12 @@ public function testTwigTransTags() { ...@@ -162,13 +162,12 @@ public function testTwigTransTags() {
* Test Twig "trans" debug markup. * Test Twig "trans" debug markup.
*/ */
public function testTwigTransDebug() { public function testTwigTransDebug() {
// Enable twig debug and write to the test settings.php file. // Enable debug, rebuild the service container, and clear all caches.
$this->settingsSet('twig_debug', TRUE); $parameters = $this->container->getParameter('twig.config');
$settings['settings']['twig_debug'] = (object) array( $parameters['debug'] = TRUE;
'value' => TRUE, $this->setContainerParameter('twig.config', $parameters);
'required' => TRUE, $this->rebuildContainer();
); $this->resetAll();
$this->writeSettings($settings);
// Get page for assertion testing. // Get page for assertion testing.
$this->drupalGet('twig-theme-test/trans', array('language' => \Drupal::languageManager()->getLanguage('xx'))); $this->drupalGet('twig-theme-test/trans', array('language' => \Drupal::languageManager()->getLanguage('xx')));
......
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