diff --git a/includes/flag.admin.inc b/includes/flag.admin.inc index 4ab59d6..b7ae4fa 100644 --- a/includes/flag.admin.inc +++ b/includes/flag.admin.inc @@ -670,6 +670,15 @@ function flag_form_submit($form, &$form_state) { // We clear caches more vigorously if the flag was new. _flag_clear_cache(!empty($flag->is_new)); + // Clear FieldAPI's field_extra cache, so our changes to pseudofields are + // noticed. It's rather too much effort to both a) check whether the + // pseudofield setting has changed either way, and b) specifically clear just + // the bundles that are (or were!!) affected, so we just clear for all bundles + // on our entity type regardlesss. + // TODO: fold this into _flag_clear_cache(). + // @see https://drupal.org/node/2056275 + cache_clear_all("field_info:bundle_extra:$flag->entity_type:", 'cache_field', TRUE); + // Save permissions. // This needs to be done after the flag cache has been cleared, so that // the new permissions are picked up by hook_permission().