diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 3b391d939918d5814c382f401abcef6af037cd04..6ac79ba187d4312bb364794491625b1e32837d94 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -327,6 +327,7 @@ Views 3.x-7.x-dev o #743682 by nicedawg: Prevent exposed filter in a block from showing up twice on validation error. o #768972 by dereine, cyberwolf and nicedawg: Add an option to disable an error message if terms do not exist on taxonomy term filter. o #812608 by drunken monkey: Views outputs unquoted version in exports. + o #402944 by drewish: Cache views block list to reduce overhead when listing blocks. Views 6.x-3.x-dev o #396380 by merlinofchaos, dereine and dagmar: Initial support for GROUP BY queries!!!!!!!!!!!! diff --git a/views.module b/views.module index 75143c809473db184e6c14690b4abd39841af5b4..fdfb38aba628fd8a6b2d7b23c93c2f7def9253cf 100644 --- a/views.module +++ b/views.module @@ -318,6 +318,13 @@ function views_page() { * Implement hook_block_info(). */ function views_block_info() { + // Try to avoid instantiating all the views just to get the blocks info. + views_include('cache'); + $cache = views_cache_get('views_block_items', TRUE); + if ($cache && is_array($cache->data)) { + return $cache->data; + } + $items = array(); $views = views_get_all_views(); foreach ($views as $view) { @@ -372,6 +379,8 @@ function views_block_info() { $view->destroy(); } + views_cache_set('views_block_items', $items, TRUE); + return $items; }