I see several errors after I enable module.
To enable it, I just add this lines to the settings.php:

$settings['memcache']['servers'] = ['127.0.0.1:11211' => 'default'];
$settings['memcache']['bins'] = ['default' => 'default'];
$settings['memcache']['key_prefix'] = 'd8';
$settings['cache']['default'] = 'cache.backend.memcache';

The errors I see:

Catchable fatal error: Argument 2 passed to Drupal\Core\Cache\DatabaseCacheTagsChecksum::isValid() must be of the type array, null given, called in /modules/contrib/memcache/src/MemcacheBackend.php on line 168 and defined in /core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php on line 97

Notice: Undefined property: stdClass::$tags in /modules/contrib/memcache/src/MemcacheBackend.php on line 168

Warning: Creating default object from empty value in modules/contrib/memcache/src/MemcacheBackend.php on line 123

Notice: Trying to get property of non-object in modules/contrib/memcache/src/MemcacheBackend.php on line 105

CommentFileSizeAuthor
#9 catchable_fatal_error-2693361-9.patch551 byteslussoluca

Comments

nortmas created an issue. See original summary.

nortmas’s picture

Title: Catchable fatal error: Argument 2 passed to Drupal\Core\Cache\DatabaseCacheTagsChecksum::isValid() must be of the type array, null given, called in /modules/contrib/memcache/src/MemcacheBackend.php on line 168 and defined in /core/lib/Drupal/Core/Cache/Da » Catchable fatal error: Argument 2 passed to Drupal\Core\Cache\DatabaseCacheTagsChecksum::isValid() must be of the type array, null given, called in /modules/contrib/memcache/src/MemcacheBackend.php on line 168
misc’s picture

I had a simiular issue, but is seems to be gone now after I patched with #2701903: Tests for: Setting prefix_key is not use by memcache to get key_prefix working

nortmas’s picture

Cool, thx!

misc’s picture

Did it solve your iusse @nortmas?

dagomar’s picture

The patch in the linked issue did not resolve this issue for me:

PHP Catchable fatal error: Argument 2 passed to Drupal\\memcache\\MemcacheBackend::valid() must be an instance of stdClass, null given

Ah, I see that my error is slightly different; it says stdClass, not Array.

misc’s picture

Which version or commit of the module are you using?

lussoluca’s picture

Status: Active » Needs review

I've the same error as @dagomar, I'm using the latest dev of memcache on Drupal 8.1.1.
The patch attached checks for return values of getMulti to see if it's non NULL and it works for me.

lussoluca’s picture

StatusFileSize
new551 bytes
jcnventura’s picture

Status: Needs review » Closed (duplicate)

This is a duplicate of #2674884: Array exception and notices, and I actually like the way the patch is built on the other one. (testing for is_object($result) instead of simply $result).. The check in #9 succeeds if $result = 1 or TRUE or simply not empty.