Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am getting the following errors in my logs on every cron run & every time I use update.php:
Notice: Undefined variable: keys in DrupalAPCCache->getMultiple() (line 172 of /hosting/somesite/com/htdocs/cms_sandbox/sites/all/modules/apc/drupal_apc_cache.inc).
Warning: array_keys() expects parameter 1 to be array, null given in DrupalAPCCache->getMultiple() (line 172 of /hosting/somesite/com/htdocs/cms_sandbox/sites/all/modules/apc/drupal_apc_cache.inc).
I am using the latest 7x.1x-dev version. Any ideas?
Comment | File | Size | Author |
---|---|---|---|
#3 | apc-undefined-index-2091647-3.patch | 445 bytes | twistor |
Comments
Comment #0.0
Anonymous (not verified) CreditAttribution: Anonymous commentedUpdated issue summary.
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedI changed the following to get the notice & warning to go away.
line 172 of drupal_apc_cache.inc was:
Changed to:
The error messages have gone away & cache creation in & deletion from the APC user cache works.
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedAdded an isset check to eliminate the persistent error messages.
Comment #3
twistor CreditAttribution: twistor commentedThe problem is that getMultiple() is being called with an empty array.
There's 2 ways to solve this.
Predefine keys so that it always exists, or return early if the $cids is empty.
I went with the latter.
Comment #5
R.Muilwijk CreditAttribution: R.Muilwijk commentedCommitted to dev.
Comment #6
R.Muilwijk CreditAttribution: R.Muilwijk commented