xero.module's xero_get_cache() calls cache_get(…, 'cache'), meaning that it caches data in rows in the {cache} table. With memcache.module, it's common practice to assign the {cache} table to be handled by Memcache.

Drupal core's implementation of cache_get() returns 0 for nonexistent entries.

But Memcache's implementation of cache_get() returns false for nonexistent entries. Since this isn't a number, xero.module's xero_get_cache() assumes it's cached data, and returns it, never calling Xero to populate the cache.

Comments

smokris’s picture

Assigned: smokris » Unassigned
Status: Active » Needs review
StatusFileSize
new416 bytes

The attached patch solves the problem for me.

mradcliffe’s picture

StatusFileSize
new478 bytes

We're not seeing the same issue on our drupal 7 sites, right? I think that's because 7.x-1.x had a fix for this. Could we try this (backport) patch instead?

smokris’s picture

Yes, our Drupal 7 site correctly populates the Xero caches, even when stored in Memcache.

That backport looks good to me; it handles both 0 and false.

  • mradcliffe committed 4d1db6e on 6.x-1.x
    Issue #2467201 by smokris, mradcliffe: Fix checking cache return value...
mradcliffe’s picture

Status: Needs review » Fixed

Tagged a release candidate for 6.x-1.2 which has a lot of fixes in it.

Status: Fixed » Closed (fixed)

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