Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d3de3672
Commit
d3de3672
authored
Nov 26, 2009
by
webchick
Browse files
#642612
by yched: Add clean way to reset entity_info() cache.
parent
37339758
Changes
6
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
d3de3672
...
...
@@ -6278,6 +6278,14 @@ function entity_get_info($entity_type = NULL) {
return
empty
(
$entity_type
)
?
$entity_info
:
$entity_info
[
$entity_type
];
}
/**
* Resets the cached information about entity types.
*/
function
entity_info_cache_clear
()
{
drupal_static_reset
(
'entity_get_info'
);
cache_clear_all
(
'entity_info'
,
'cache'
);
}
/**
* Helper function to extract id, vid, and bundle name from an entity.
*
...
...
modules/field/field.info.inc
View file @
d3de3672
...
...
@@ -26,8 +26,7 @@
function
field_info_cache_clear
()
{
// @todo: Remove this when field_attach_*_bundle() bundle management
// functions are moved to the entity API.
drupal_static_reset
(
'entity_get_info'
);
cache_clear_all
(
'entity_info'
,
'cache'
);
entity_info_cache_clear
();
_field_info_collate_types
(
TRUE
);
drupal_static_reset
(
'field_build_modes'
);
...
...
modules/field/tests/field_test.module
View file @
d3de3672
...
...
@@ -105,8 +105,7 @@ function field_test_entity_info_translatable($obj_type = NULL, $translatable = N
$stored_value
=
&
drupal_static
(
__FUNCTION__
,
array
());
if
(
isset
(
$obj_type
))
{
$stored_value
[
$obj_type
]
=
$translatable
;
drupal_static_reset
(
'entity_get_info'
);
cache_clear_all
(
'entity_info'
,
'cache'
);
entity_info_cache_clear
();
}
return
$stored_value
;
}
...
...
modules/rdf/rdf.module
View file @
d3de3672
...
...
@@ -163,8 +163,7 @@ function rdf_mapping_save(&$mapping) {
))
->
execute
();
cache_clear_all
(
'entity_info'
,
'cache'
);
drupal_static_reset
(
'entity_get_info'
);
entity_info_cache_clear
();
return
$status
;
}
...
...
@@ -258,8 +257,7 @@ function rdf_rdfa_attributes($mapping, $data = NULL) {
function
rdf_modules_installed
(
$modules
)
{
// We need to clear the caches of entity_info as this is not done right
// during the tests. see http://drupal.org/node/594234
cache_clear_all
(
'entity_info'
,
'cache'
);
drupal_static_reset
(
'entity_get_info'
);
entity_info_cache_clear
();
foreach
(
$modules
as
$module
)
{
$function
=
$module
.
'_rdf_mapping'
;
...
...
modules/rdf/rdf.test
View file @
d3de3672
...
...
@@ -138,8 +138,7 @@ class RdfMappingDefinitionTestCase extends DrupalWebTestCase {
rdf_modules_installed
(
array
(
'rdf_test'
,
'node'
));
// entity_info caches must be cleared during testing. This is done
// automatically during the manual installation.
cache_clear_all
(
'entity_info'
,
'cache'
);
drupal_static_reset
(
'entity_get_info'
);
entity_info_cache_clear
();
}
/**
...
...
modules/system/system.admin.inc
View file @
d3de3672
...
...
@@ -1055,7 +1055,7 @@ function system_modules_submit($form, &$form_state) {
node_types_rebuild
();
menu_rebuild
();
cache_clear_all
(
'schema'
,
'cache'
);
cache_clear_all
(
'
entity_info
'
,
'
cache
'
);
entity_info
_
cache
_clear
(
);
drupal_clear_css_cache
();
drupal_clear_js_cache
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment