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

8.0.x
Alex Pott 2014-09-09 15:11:04 +01:00
parent 973fd26d96
commit 078f09a588
2 changed files with 7 additions and 8 deletions

View File

@ -83,7 +83,7 @@ class TwigNodeTrans extends \Twig_Node {
$compiler->raw(')');
// Append translation debug markup, if necessary.
if (Settings::get('twig_debug', FALSE)) {
if ($compiler->getEnvironment()->isDebug()) {
$compiler->raw(" . '\n<!-- TRANSLATION: ");
$compiler->subcompile($singular);
if (!empty($plural)) {

View File

@ -162,13 +162,12 @@ class TwigTransTest extends WebTestBase {
* Test Twig "trans" debug markup.
*/
public function testTwigTransDebug() {
// Enable twig debug and write to the test settings.php file.
$this->settingsSet('twig_debug', TRUE);
$settings['settings']['twig_debug'] = (object) array(
'value' => TRUE,
'required' => TRUE,
);
$this->writeSettings($settings);
// Enable debug, rebuild the service container, and clear all caches.
$parameters = $this->container->getParameter('twig.config');
$parameters['debug'] = TRUE;
$this->setContainerParameter('twig.config', $parameters);
$this->rebuildContainer();
$this->resetAll();
// Get page for assertion testing.
$this->drupalGet('twig-theme-test/trans', array('language' => \Drupal::languageManager()->getLanguage('xx')));