Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
301
Merge Requests
301
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
dd39df9d
Commit
dd39df9d
authored
Oct 16, 2013
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2087243
by olli: Fixed Views block category is double escaped with autocomplete.
parent
24f3e119
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
core/modules/block/lib/Drupal/block/Controller/CategoryAutocompleteController.php
...rupal/block/Controller/CategoryAutocompleteController.php
+1
-2
core/modules/block/tests/Drupal/block/Tests/CategoryAutocompleteTest.php
...ock/tests/Drupal/block/Tests/CategoryAutocompleteTest.php
+2
-2
No files found.
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