Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I am using version 7.x-1.6 when i am going for enable module from admin it shows me fatal error
Fatal error: Call to a member function getStats() on boolean in D:\XAMPP\htdocs\xxxxxxx\sites\all\modules\contrib\memcache\memcache-lock.inc on line 19
Comment | File | Size | Author |
---|---|---|---|
#7 | memcache-call-to-member-function-on-boolean-fix-2879600-7.patch | 677 bytes | osopolar |
Comments
Comment #2
dodozhang21 CreditAttribution: dodozhang21 commentedWe saw this as well. This requires a patch. The reasons is that dmemcache_object('semaphore'); can return a boolean and calling $mc->getStatus() on a boolean gives this FATAL error.
Comment #3
dodozhang21 CreditAttribution: dodozhang21 commentedOoops not sure what happened to the first one. Try 2.
Comment #4
SamirMtl CreditAttribution: SamirMtl as a volunteer commentedHi
Thank you dodozhang21 for this patch, but it seems not applicable for every one
Please, take a look at this patch https://www.drupal.org/files/issues/memcache_api_and_integration-memcach... , and pay attention on the path of the file to patch, in your patch the file to patch is b/sites/all/modules/contrib/memcache/memcache-lock.inc, you may specify the file location like so : b/memcache-lock.inc
Comment #5
agusluc88 CreditAttribution: agusluc88 commentedI'm getting the same error on almost every page load.
Tried the patch of #3 and solved the problem.
Drupal 7.53
PHP 5.5.38
AWS Memcached Client 1.0.1 (x64)
Comment #6
alebnn CreditAttribution: alebnn commentedHi, unfortunately none of the solutions provided is working for me....
Here my updated (and still not working) memcache-lock.inc
<?php
/**
* @file
* A memcache based implementation of a locking mechanism.
* See includes/lock.inc for documenation
*/
require_once dirname(__FILE__) . '/dmemcache.inc';
// Check if memcached is available - if not include default lock handler.
// @todo get rid of this conditional include as soon as this is done:
// http://drupal.org/node/1225404
$lock_file = dirname(__FILE__) . '/memcache-lock-code.inc';
$mc = dmemcache_object('semaphore');
// dmemcache_object always returns TRUE, we don't need these stats but it forces
// us to try and connect to memcache. If this fails, we can't store locks in
// memcache.
if (!$mc || !$mc->getStats()) {
// (!$mc->getStats()) {
$lock_file = DRUPAL_ROOT . '/includes/lock.inc';
}
require_once $lock_file;
any help/support is highly appreciated,
Alejandro.
Comment #7
osopolarPatch #3 works for me to. I just fixed the -p1 compatibility of the patch file, as in #4.
Comment #8
guilopes CreditAttribution: guilopes as a volunteer commentedI think we can go ahead an merge it on. The patch solve the problems
Comment #9
andrex84 CreditAttribution: andrex84 commentedIt works for me, thanks a lot
Comment #10
ciss CreditAttribution: ciss at yousign GmbH commentedI just got a status update mail for this issue, but I don't see any changes. What's going on?
Comment #11
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commented+1 for RTBC, makes sense
Comment #13
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedThanks! Fix committed.
Comment #15
btully CreditAttribution: btully commentedThanks for this patch @dodozhang21 and @osopolar :)
Comment #16
mattwmc CreditAttribution: mattwmc commentedGot the error when upgrading to php 7.1 and patches do not work.
Any ideas? Thanks.
Comment #17
sokru CreditAttribution: sokru as a volunteer commented@mattwmc got same issue when upgrading to php 7.1. Using dev version (#fbdbd70) fixed the issue.