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
221
Merge Requests
221
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
6c8d0826
Commit
6c8d0826
authored
May 09, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2254777
by m1r1k: Block category autocomplete does not work.
parent
938ac1f5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
core/modules/block/lib/Drupal/block/Controller/CategoryAutocompleteController.php
...rupal/block/Controller/CategoryAutocompleteController.php
+1
-1
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 @
6c8d0826
...
...
@@ -59,7 +59,7 @@ public function autocomplete(Request $request) {
$matches
=
array
();
foreach
(
$this
->
blockManager
->
getCategories
()
as
$category
)
{
if
(
stripos
(
$category
,
$typed_category
)
===
0
)
{
$matches
[
$category
]
=
String
::
checkPlain
(
$category
);
$matches
[
]
=
array
(
'value'
=>
$category
,
'label'
=>
String
::
checkPlain
(
$category
)
);
}
}
return
new
JsonResponse
(
$matches
);
...
...
core/modules/block/tests/Drupal/block/Tests/CategoryAutocompleteTest.php
View file @
6c8d0826
...
...
@@ -59,8 +59,8 @@ public function setUp() {
*/
public
function
testAutocompleteSuggestions
(
$string
,
$suggestions
)
{
$suggestions
=
array_map
(
function
(
$suggestion
)
{
return
String
::
checkPlain
(
$suggestion
);
},
array_combine
(
$suggestions
,
$suggestions
)
);
return
array
(
'value'
=>
$suggestion
,
'label'
=>
String
::
checkPlain
(
$suggestion
)
);
},
$suggestions
);
$result
=
$this
->
autocompleteController
->
autocomplete
(
new
Request
(
array
(
'q'
=>
$string
)));
$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