Mercurial > hg > isophonics-drupal-site
comparison core/modules/system/src/Controller/EntityAutocompleteController.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
2 | 2 |
3 namespace Drupal\system\Controller; | 3 namespace Drupal\system\Controller; |
4 | 4 |
5 use Drupal\Component\Utility\Crypt; | 5 use Drupal\Component\Utility\Crypt; |
6 use Drupal\Component\Utility\Tags; | 6 use Drupal\Component\Utility\Tags; |
7 use Drupal\Component\Utility\Unicode; | |
8 use Drupal\Core\Controller\ControllerBase; | 7 use Drupal\Core\Controller\ControllerBase; |
9 use Drupal\Core\Entity\EntityAutocompleteMatcher; | 8 use Drupal\Core\Entity\EntityAutocompleteMatcher; |
10 use Drupal\Core\KeyValueStore\KeyValueStoreInterface; | 9 use Drupal\Core\KeyValueStore\KeyValueStoreInterface; |
11 use Drupal\Core\Site\Settings; | 10 use Drupal\Core\Site\Settings; |
12 use Symfony\Component\DependencyInjection\ContainerInterface; | 11 use Symfony\Component\DependencyInjection\ContainerInterface; |
79 public function handleAutocomplete(Request $request, $target_type, $selection_handler, $selection_settings_key) { | 78 public function handleAutocomplete(Request $request, $target_type, $selection_handler, $selection_settings_key) { |
80 $matches = []; | 79 $matches = []; |
81 // Get the typed string from the URL, if it exists. | 80 // Get the typed string from the URL, if it exists. |
82 if ($input = $request->query->get('q')) { | 81 if ($input = $request->query->get('q')) { |
83 $typed_string = Tags::explode($input); | 82 $typed_string = Tags::explode($input); |
84 $typed_string = Unicode::strtolower(array_pop($typed_string)); | 83 $typed_string = mb_strtolower(array_pop($typed_string)); |
85 | 84 |
86 // Selection settings are passed in as a hashed key of a serialized array | 85 // Selection settings are passed in as a hashed key of a serialized array |
87 // stored in the key/value store. | 86 // stored in the key/value store. |
88 $selection_settings = $this->keyValue->get($selection_settings_key, FALSE); | 87 $selection_settings = $this->keyValue->get($selection_settings_key, FALSE); |
89 if ($selection_settings !== FALSE) { | 88 if ($selection_settings !== FALSE) { |