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
dd39df9d
Commit
dd39df9d
authored
Oct 16, 2013
by
catch
Browse files
Issue
#2087243
by olli: Fixed Views block category is double escaped with autocomplete.
parent
24f3e119
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/block/lib/Drupal/block/Controller/CategoryAutocompleteController.php
View file @
dd39df9d
...
...
@@ -59,8 +59,7 @@ public function autocomplete(Request $request) {
$matches
=
array
();
foreach
(
$this
->
blockManager
->
getCategories
()
as
$category
)
{
if
(
stripos
(
$category
,
$typed_category
)
===
0
)
{
$category
=
String
::
checkPlain
(
$category
);
$matches
[
$category
]
=
$category
;
$matches
[
$category
]
=
String
::
checkPlain
(
$category
);
}
}
return
new
JsonResponse
(
$matches
);
...
...
core/modules/block/tests/Drupal/block/Tests/CategoryAutocompleteTest.php
View file @
dd39df9d
...
...
@@ -63,9 +63,9 @@ public function setUp() {
public
function
testAutocompleteSuggestions
(
$string
,
$suggestions
)
{
$suggestions
=
array_map
(
function
(
$suggestion
)
{
return
String
::
checkPlain
(
$suggestion
);
},
$suggestions
);
},
MapArray
::
copyValuesToKeys
(
$suggestions
)
)
;
$result
=
$this
->
autocompleteController
->
autocomplete
(
new
Request
(
array
(
'q'
=>
$string
)));
$this
->
assertSame
(
MapArray
::
copyValuesToKeys
(
$suggestions
)
,
json_decode
(
$result
->
getContent
(),
TRUE
));
$this
->
assertSame
(
$suggestions
,
json_decode
(
$result
->
getContent
(),
TRUE
));
}
/**
...
...
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