When ctools_export sends an array of items to fetch to getmultiple, the items are keyed not by the items names, but by a standard 0-x number. Therefor, the following line will not work

unset($cids[$cid]);

The following patch, removes that line, and replaces it with

$cids = array_diff($cids, array_keys($results));

Which was copied from the APC module.

CommentFileSizeAuthor
ctools_export_getmultiple_fix.patch419 bytesbatje
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

SocialNicheGuru’s picture

Issue summary: View changes
Status: Active » Needs review
SocialNicheGuru’s picture

Status: Needs review » Needs work

I got this when I implemented this patch

PHP Fatal error: Declaration of DrupalFileCache::getMultiple() must be compatible with DrupalCacheInterface::getMultiple(&$cids) in sites/all/modulesfilecache/filecache.inc on line 66

  • ogi committed 20cc4b6 on 7.x-1.x
    Issue #1951830: ctools_export getmultiple is broken
    

  • ogi committed 3bfbf81 on 7.x-1.x
    Issue #1951830: ctools_export getmultiple is broken (fix typo)
    
ogi’s picture

Status: Needs work » Fixed

Fixed (hopefully).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.