Entitycache module is good for speeding things up on a node and user-heavy site. However, its cache needs to be cleared whenever changes happen to the user object. Twitter module doesn't save its settings using user_save(), so cache clearing isn't invoked. Attached patch makes it work with entitycache.

CommentFileSizeAuthor
patch_commit_f2214eadf1c1.patch1.43 KBmoonray
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

juampynr’s picture

Status: Needs review » Needs work

I think this would be much more flexibly integrated through a hook at Twitter module so Entity Cache can jump in and clear.

Looking forward for a patch.

moonray’s picture

I doubt it's within the scope of entity cache module to go clearing out the cache for each and every module enable on the site that happens to invalidate entities.

juampynr’s picture

OK, I will discuss this with more people. I am worried that, with this approach, the module could get a lot of "if (module_exist('module_name')" statements, which could make it less maintainable. Instead, it could implement hooks at certain points and submodules that would jump in them (such as a twitter_entitycache submodule).

We are doing a DrupalConTribute event this Saturday at Spain so I am looking forward for a patch on this and other issues.

Thanks for the initiative on this.

Fidelix’s picture

Any news on this?

It simply makes sense that twitter integrates with entitycache, and not the other way around.

kenneth.venken’s picture

It seems that the twitter library isn't loaded when entitycache deserializes the user object.
Adding

/**
 * Because of incompatibility between the entitycache and twitter modules.
 * @see: http://drupal.org/node/1238078;
 */
require_once(libraries_get_path('twitter') . '/twitter.lib.php');

/**
 * Implements hook_init().
 */
function q_social_init() {
  // @see: http://drupal.org/node/1238078;
  $menu = menu_get_item();
  if ($menu['path'] == 'user/%/edit/settings') {
    $account = menu_get_object('user');
    cache_clear_all($account->uid, 'cache_entity_user');
  }
}

to the top of one of my modules fixes the issue for me.

dddave’s picture

Version: 7.x-3.x-dev » 7.x-6.x-dev

Is this still relevant?

DamienMcKenna’s picture

Issue summary: View changes
Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, patch_commit_f2214eadf1c1.patch, failed testing.