Skip to content

Instantly share code, notes, and snippets.

@labboy0276
Last active March 26, 2019 18:35
Show Gist options
  • Save labboy0276/8bbb57b1780f20f45b96c3e1480350b7 to your computer and use it in GitHub Desktop.
Save labboy0276/8bbb57b1780f20f45b96c3e1480350b7 to your computer and use it in GitHub Desktop.
temp.patch
diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
index f451e508fa..a32c66353b 100644
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -725,7 +725,7 @@ protected function expandArguments(&$query, &$args) {
throw new \InvalidArgumentException('Placeholders with a trailing [] can only be expanded with an array of values.');
}
elseif (!$is_bracket_placeholder) {
- if ($is_array_data) {
+ if ($is_array_data && !empty($data)) {
throw new \InvalidArgumentException('Placeholders must have a trailing [] if they are to be expanded with an array of values.');
}
// Scalar placeholder - does not need to be expanded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment