summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Seidl2018-02-21 10:47:16 (GMT)
committerThomas Seidl2018-02-21 10:47:16 (GMT)
commit67985544bb98de34b553c8b5dfd60f650a5dd113 (patch)
tree7f3f7588d612c27fce886423703e30ba8a54cb55
parentc8cd1fc51e2f6977fd9be55e0077e7a3c05a823c (diff)
Issue #2912246 by drunken monkey: Fixed inconsistent array indices in query languages.
-rw-r--r--CHANGELOG.txt2
-rw-r--r--phpcs.xml2
-rw-r--r--src/Query/Query.php2
3 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 4c2381c..76c7202 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,7 @@
Search API 1.x, dev (xxxx-xx-xx):
---------------------------------
+- #2912246 by drunken monkey: Fixed inconsistent array indices in query
+ languages.
- #2939405 by bserem, borisson_, drunken monkey, yoroy: Improved UI text on
what is included in the index.
- #2943705 by kevin.dutra, drunken monkey, borisson_: Fixed performance
diff --git a/phpcs.xml b/phpcs.xml
index 5ff5509..6449d59 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -6,7 +6,7 @@
<!-- Only include specific sniffs that pass. This ensures that, if new sniffs are added, HEAD does not fail.-->
<!-- Drupal sniffs -->
- <rule ref="Drupal.Array.DisallowLongArraySyntax"/>
+ <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Drupal.Classes.ClassCreateInstance"/>
<rule ref="Drupal.Classes.ClassDeclaration"/>
<rule ref="Drupal.Classes.FullyQualifiedNamespace"/>
diff --git a/src/Query/Query.php b/src/Query/Query.php
index 2c7b7be..c07780f 100644
--- a/src/Query/Query.php
+++ b/src/Query/Query.php
@@ -362,7 +362,7 @@ class Query implements QueryInterface {
* {@inheritdoc}
*/
public function setLanguages(array $languages = NULL) {
- $this->languages = $languages;
+ $this->languages = isset($languages) ? array_values($languages) : NULL;
return $this;
}