Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
078f09a5
Commit
078f09a5
authored
Sep 09, 2014
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2332989
by Cottser: Fixed Twig trans tag debug is still hooked up to Settings.
parent
973fd26d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
core/lib/Drupal/Core/Template/TwigNodeTrans.php
core/lib/Drupal/Core/Template/TwigNodeTrans.php
+1
-1
core/modules/system/src/Tests/Theme/TwigTransTest.php
core/modules/system/src/Tests/Theme/TwigTransTest.php
+6
-7
No files found.
core/lib/Drupal/Core/Template/TwigNodeTrans.php
View file @
078f09a5
...
...
@@ -83,7 +83,7 @@ public function compile(\Twig_Compiler $compiler) {
$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
))
{
...
...
core/modules/system/src/Tests/Theme/TwigTransTest.php
View file @
078f09a5
...
...
@@ -162,13 +162,12 @@ public function testTwigTransTags() {
* 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'
)));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment