I had a lot of PHP Notices in my logs due to Redis cache_get implementation, and found it originated from this module, more precisely this piece of code:

public static function resetEntityCache($controller, array $ids = NULL) {
    // Reset the persistent cache.
    if (!empty($ids)) {
      cache_clear_all($ids, 'cache_entity_' . $controller->entityType);
    }
    ...

Calling cache_clear_all with an array instead of the (string) cid will not work as expected.

Obvious solution:

public static function resetEntityCache($controller, array $ids = NULL) {
    // Reset the persistent cache.
    if (!empty($ids)) {
      foreach ($ids as $id) {
        cache_clear_all($id, 'cache_entity_' . $controller->entityType);
      }
    }
    ...

Comments

mdupont’s picture

Status: Active » Closed (works as designed)

Forget it, it's actually a valid use of cache_clear_all(), it's the Redis implementation that doesn't handle this case.