Issue #1860876 by pounard: Fixed module_implements_write_cache() should not drop caches when requesting with POST method.
parent
2df0b841f5
commit
cadd940917
|
@ -1,6 +1,9 @@
|
||||||
|
|
||||||
Drupal 7.23, xxxx-xx-xx (development version)
|
Drupal 7.23, xxxx-xx-xx (development version)
|
||||||
-----------------------
|
-----------------------
|
||||||
|
- Performance improvement: Allowed all hooks to be included in the
|
||||||
|
module_implements() cache, even those that are only invoked on HTTP POST
|
||||||
|
requests.
|
||||||
- Made the database system replace truncate queries with delete queries when
|
- Made the database system replace truncate queries with delete queries when
|
||||||
inside a transaction, to fix issues with PostgreSQL and other databases.
|
inside a transaction, to fix issues with PostgreSQL and other databases.
|
||||||
- Fixed a bug which caused nested contextual links to display improperly.
|
- Fixed a bug which caused nested contextual links to display improperly.
|
||||||
|
|
|
@ -834,10 +834,7 @@ function module_hook_info() {
|
||||||
*/
|
*/
|
||||||
function module_implements_write_cache() {
|
function module_implements_write_cache() {
|
||||||
$implementations = &drupal_static('module_implements');
|
$implementations = &drupal_static('module_implements');
|
||||||
// Check whether we need to write the cache. We do not want to cache hooks
|
if (isset($implementations['#write_cache'])) {
|
||||||
// which are only invoked on HTTP POST requests since these do not need to be
|
|
||||||
// optimized as tightly, and not doing so keeps the cache entry smaller.
|
|
||||||
if (isset($implementations['#write_cache']) && ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD')) {
|
|
||||||
unset($implementations['#write_cache']);
|
unset($implementations['#write_cache']);
|
||||||
cache_set('module_implements', $implementations, 'cache_bootstrap');
|
cache_set('module_implements', $implementations, 'cache_bootstrap');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue