Skip to content

Commit 8833395

Browse files
author
Jeremy Andrews
committed
Issue #2848252 by lhridley, Jeremy: drush clear-cache results in: array_merge(): Argument #2 is not an array dmemcache.inc:404
1 parent 7f78336 commit 8833395

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

dmemcache.inc

+7-4
Original file line numberDiff line numberDiff line change
@@ -399,17 +399,20 @@ function dmemcache_get_multi($keys, $bin = 'cache', $mc = NULL) {
399399

400400
$results = @$mc->get($full_keys);
401401

402-
// Order is not guaranteed, map responses to order of requests.
403-
$keys = array_fill_keys($full_keys, NULL);
404-
$results = array_merge($keys, $results);
405-
406402
if (!empty($php_errormsg)) {
407403
register_shutdown_function('watchdog', 'memcache', 'Exception caught in dmemcache_get_multi: !msg', array('!msg' => $php_errormsg), WATCHDOG_WARNING);
408404
$php_errormsg = '';
409405
}
410406
ini_set('track_errors', $track_errors);
407+
408+
// Order is not guaranteed, map responses to order of requests.
409+
if (is_array($results)) {
410+
$keys = array_fill_keys($full_keys, NULL);
411+
$results = array_merge($keys, $results);
412+
}
411413
}
412414
}
415+
413416
// If $results is FALSE, convert it to an empty array.
414417
if (!$results) {
415418
$results = array();

0 commit comments

Comments
 (0)