1

I'm having an issue whereby clearing Civi cache is the only way to make some fields visible on a Drupal 7 user profile. I've tried to debug the issue and it seems to be caused by anonymous users viewing the account, where they don't have the permission to view those fields and it caches that result of seeing nothing.

My issue for now however, is that in Drupal's sites/default/civicrm.settings.php file, I've set the cache to:

  define('CIVICRM_DB_CACHE_CLASS', 'NoCache');

I've debugged it and check that CIVICRM_DB_CACHE_CLASS has not already been defined but Civi is still caching those results. How can I fix this or how else can I turn off Civi caching?

Logged in as admin, this is what the profile looks like before clearing caches: Missing fields before cache clear

And then after clearing caches: Fields after clearing cache

  • It sounds like your issue is compiled Smarty templates, not traditional caching. Could you edit your question to include a screenshot so folks can better assess? – Jon G - Megaphone Tech Jan 29 at 12:22
  • Of the fields that would be missing or the templates_c directory? TIA for helping – AlbionBrown Jan 29 at 14:09
  • A screenshot of the missing fields. You can also try deleting templates_c and immediately reload the page. If you see a difference, we've isolated the problem and can work on finding the root cause. – Jon G - Megaphone Tech Jan 29 at 20:27
  • Annoyingly, the cache is behaving itself this morning, it wasn't yesterday. So, I might need to follow this up later today/tomorrow. – AlbionBrown Jan 30 at 10:45
  • I tired clearing down the templates_c directory but it didn't seem to do anything. When I've stepped through it with xdebug it doesn't seem to make any contact with templates_c, only the civicrm_cache table. But I've edited for those screenshots now. – AlbionBrown Jan 31 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.