(bug 33456) show $wgQueryCacheLimit on cached query pages, so users know that the...
authorBrian Wolff <bawolff@users.mediawiki.org>
Thu, 5 Jan 2012 16:14:52 +0000 (16:14 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Thu, 5 Jan 2012 16:14:52 +0000 (16:14 +0000)
RELEASE-NOTES-1.19
includes/QueryPage.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php

index edc84ed..794da3f 100644 (file)
@@ -116,6 +116,7 @@ production.
   Enable by setting $wgEnableJavaScriptTest to true.
 * Extensions can use the RequestContextCreateSkin hook to override what skin is
   loaded in some contexts.
+* (bug 33456) Show $wgQueryCacheLimit on cached query pages.
 
 === Bug fixes in 1.19 ===
 * $wgUploadNavigationUrl should be used for file redlinks if.
index ef675c0..12321ab 100644 (file)
@@ -437,6 +437,7 @@ abstract class QueryPage extends SpecialPage {
         * real, honest-to-gosh query page.
         */
        function execute( $par ) {
+               global $wgQueryCacheLimit;
                if ( !$this->userCanExecute( $this->getUser() ) ) {
                        $this->displayRestrictionError();
                        return;
@@ -468,17 +469,18 @@ abstract class QueryPage extends SpecialPage {
 
                                # Fetch the timestamp of this update
                                $ts = $this->getCachedTimestamp();
+                               $lang = $this->getLanguage();
+                               $maxResults = $lang->formatNum( $wgQueryCacheLimit );
 
                                if ( $ts ) {
-                                       $lang = $this->getLanguage();
                                        $updated = $lang->timeanddate( $ts, true, true );
                                        $updateddate = $lang->date( $ts, true, true );
                                        $updatedtime = $lang->time( $ts, true, true );
                                        $out->addMeta( 'Data-Cache-Time', $ts );
                                        $out->addInlineScript( "var dataCacheTime = '$ts';" );
-                                       $out->addWikiMsg( 'perfcachedts', $updated, $updateddate, $updatedtime );
+                                       $out->addWikiMsg( 'perfcachedts', $updated, $updateddate, $updatedtime, $maxResults );
                                } else {
-                                       $out->addWikiMsg( 'perfcached' );
+                                       $out->addWikiMsg( 'perfcached', $maxResults );
                                }
 
                                # If updates on this page have been disabled, let the user know
index 9af7999..7774927 100644 (file)
@@ -999,8 +999,8 @@ It may have already been deleted by someone else.',
 'badtitle'             => 'Bad title',
 'badtitletext'         => 'The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title.
 It may contain one or more characters which cannot be used in titles.',
-'perfcached'           => 'The following data is cached and may not be up to date.',
-'perfcachedts'         => 'The following data is cached, and was last updated $1.',
+'perfcached'           => 'The following data is cached and may not be up to date. A maximum of $1 results are available in the cache.',
+'perfcachedts'         => 'The following data is cached, and was last updated $1. A maximum of $4 results are available in the cache.',
 'querypage-no-updates' => 'Updates for this page are currently disabled.
 Data here will not presently be refreshed.',
 'wrong_wfQuery_params' => 'Incorrect parameters to wfQuery()<br />
index cc5cf92..cf7115d 100644 (file)
@@ -655,10 +655,12 @@ $1 is a filename, I think.',
 * $1 is the page name',
 'badtitle'             => 'The page title when a user requested a page with invalid page name. The content will be {{msg-mw|badtitletext}}.',
 'badtitletext'         => 'The message shown when a user requested a page with invalid page name. The page title will be {{msg-mw|badtitle}}.',
+'perfcached'           => 'Like {{msg-mw|perfcachedts}} but used when we do not know how long ago page was cached (unlikely to happen). $1 is the max result cut off ($wgQueryCacheLimit)',
 'perfcachedts'         => 'Used on pages that list page lists for which the displayed data is cached. Parameters:
 * $1 is a time stamp (date and time combined)
 * $2 is a date (optional)
-* $3 is a time (optional)',
+* $3 is a time (optional)
+* $4 is the cut off limit for cached results ($wgQueryCacheLimit). If there are more then this many results for the query, only the first $4 of those will be listed on the page. Usually $4 is about 1000.',
 'querypage-no-updates' => 'Text on some special pages, e.g. [[Special:FewestRevisions]].',
 'viewsource'           => 'The text displayed in place of the "edit" tab when the user has no permission to edit the page.