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
6a168b0d
Commit
6a168b0d
authored
Aug 25, 2014
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2326397
by davidhernandez: Fixed Add filtering to AttributeArray.
parent
584911ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
core/lib/Drupal/Core/Template/AttributeArray.php
core/lib/Drupal/Core/Template/AttributeArray.php
+2
-0
core/tests/Drupal/Tests/Core/Template/AttributeTest.php
core/tests/Drupal/Tests/Core/Template/AttributeTest.php
+2
-0
No files found.
core/lib/Drupal/Core/Template/AttributeArray.php
View file @
6a168b0d
...
...
@@ -66,6 +66,8 @@ public function offsetExists($offset) {
* Implements the magic __toString() method.
*/
public
function
__toString
()
{
// Filter out any empty values before printing.
$this
->
value
=
array_filter
(
$this
->
value
);
return
String
::
checkPlain
(
implode
(
' '
,
$this
->
value
));
}
...
...
core/tests/Drupal/Tests/Core/Template/AttributeTest.php
View file @
6a168b0d
...
...
@@ -178,6 +178,8 @@ public function providerTestAttributeClassHelpers() {
'himalchuli annapurna-ii'
,
array
(
'class'
=>
array
(
'himalchuli'
,
'nuptse'
)),
),
// Test for the removal of an empty class name.
array
(
"{{ attributes.addClass('rakaposhi', '').class }}"
,
'rakaposhi'
),
);
}
...
...
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