Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Sep 2009 at 12:55 UTC
Updated:
17 Dec 2010 at 06:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedOk, my first concern was that this would cause problems for get-all-views but it doesn't seem to really be an issue since that skips the cache which is just fine. Committed to all branches.
Note that CTools would probably benefit from this kind of thing too in its handling of defaults.
Comment #3
yhahn commentedI discovered a bug with my previous patch - the index cache also needs to be localized in order to keep a record of whether the default views have been retrieved and cached in the current site language. Without this patch, sites in multiple languages can have default views that are not retrieved and cached properly.
Patch attached, applies to both DRUPAL-6--2 and DRUPAL-6--3.
Comment #4
bendiy commented@yhahn
Thanks for this patch! I'm developing a site with over 60 different Views, most of them are fairly large and I was experiencing terrible page load times. devel was reporting this query often taking in excess of 3000 ms.
SELECT data, created, headers, expire, serialized FROM cache_views WHERE cid = 'views_default_views:en'On some page loads, I was seeing results like this:
Executed 76 queries in 296.6 milliseconds. Queries taking longer than 5 ms and queries executed more than once, are highlighted. Page execution time was 6105.71 ms.They now look like this:
Executed 77 queries in 154.87 milliseconds. Queries taking longer than 5 ms and queries executed more than once, are highlighted. Page execution time was 695.25 ms.I have applied your patch @ #3 for multiple language sites. It appears to be working fine for me, however, I don't use any multi-language featuers at the moment.
THANK YOU!
Comment #5
YK85 commentedsubscribing
what sort of error would we experience on a multi-language site without the correction in patch#3?
i hope the correction will be committed after review by merlinofchaos
Comment #6
yhahn commentedYou will experience pretty serious #fail when switching languages. Basically the cache is not properly populated for non-default languages and you will get bad page loads on views in the alternate language. If you're running a multilingual site, definitely apply the patch (and test!) for the time being.
Comment #7
merlinofchaos commentedIt looks like this already got committed in a different patch.
Comment #9
catchThis introduced a race condition on high traffic sites, see #853864: views_get_default_view() - race conditions and memory usage.