Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
6a168b0d
Commit
6a168b0d
authored
Aug 25, 2014
by
webchick
Browse files
Issue
#2326397
by davidhernandez: Fixed Add filtering to AttributeArray.
parent
584911ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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