简体   繁体   中英

how to clear node custom field cache in drupal 7

I'm using Drupal 7. i changed the value of one custom field from the site, with a sql query, but when i trying to edit the node in the admin, the value of the field was the old one.
what can i do to fix this issue, without clearing the cache from the admin panel?

You can try to clear cache after modification via SQL query:

 // Clear field cache
 cache_clear_all("field:node:$nid", 'cache_field');

Or for other entities

cache_clear_all("field:$entity_type:$entity->id", 'cache_field');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM