summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Andrews2017-02-09 09:37:19 (GMT)
committerJeremy Andrews2017-02-09 09:37:19 (GMT)
commit8833395ad349410890c65d95dbcd9fe4163664da (patch)
treec69297a97e01de3fefc20b01cb23f40257c4a750
parent7f78336b0d210eecc1dc83a9149dabca704e952d (diff)
Issue #2848252 by lhridley, Jeremy: drush clear-cache results in: array_merge(): Argument #2 is not an array dmemcache.inc:4047.x-1.6-rc2
-rw-r--r--dmemcache.inc11
1 files changed, 7 insertions, 4 deletions
diff --git a/dmemcache.inc b/dmemcache.inc
index d55cb6f..8e253dd 100644
--- a/dmemcache.inc
+++ b/dmemcache.inc
@@ -399,17 +399,20 @@ function dmemcache_get_multi($keys, $bin = 'cache', $mc = NULL) {
$results = @$mc->get($full_keys);
- // Order is not guaranteed, map responses to order of requests.
- $keys = array_fill_keys($full_keys, NULL);
- $results = array_merge($keys, $results);
-
if (!empty($php_errormsg)) {
register_shutdown_function('watchdog', 'memcache', 'Exception caught in dmemcache_get_multi: !msg', array('!msg' => $php_errormsg), WATCHDOG_WARNING);
$php_errormsg = '';
}
ini_set('track_errors', $track_errors);
+
+ // Order is not guaranteed, map responses to order of requests.
+ if (is_array($results)) {
+ $keys = array_fill_keys($full_keys, NULL);
+ $results = array_merge($keys, $results);
+ }
}
}
+
// If $results is FALSE, convert it to an empty array.
if (!$results) {
$results = array();