Back out r41786 for now "(bug 9226) Fetch restrictions properly on export"
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 13 Oct 2008 00:08:44 +0000 (00:08 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 13 Oct 2008 00:08:44 +0000 (00:08 +0000)
Per http://www.mediawiki.org/wiki/Special:Code/MediaWiki/41786#c121:

Issues:

   1. Restriction fetches may not be synchronous with original start in a long-running export
   2. Looks like this adds an SQL query to slave for every single page
   3. In case of timed-out DB connections or a dying slave, this might break a long-running dump process

includes/Export.php

index 72e8f1e..827561e 100644 (file)
@@ -425,20 +425,13 @@ class XmlDumpWriter {
         * @access private
         */
        function openPage( $row ) {
-               global $wgRestrictionTypes;
                $out = "  <page>\n";
                $title = Title::makeTitle( $row->page_namespace, $row->page_title );
                $out .= '    ' . wfElementClean( 'title', array(), $title->getPrefixedText() ) . "\n";
                $out .= '    ' . wfElement( 'id', array(), strval( $row->page_id ) ) . "\n";
-               # Get page restrictions
-               $restrictions = array();
-               foreach( $wgRestrictionTypes as $action ) {
-                       $restrictions[$action] = implode( '', $title->getRestrictions( $action ) );
-               }
-               $restrictions = Article::flattenRestrictions( $restrictions );
-               if( '' != $restrictions ) {
-                       $out .= '    ' . wfElement( 'restrictions', array(), 
-                               strval( $restrictions ) ) . "\n";
+               if( '' != $row->page_restrictions ) {
+                       $out .= '    ' . wfElement( 'restrictions', array(),
+                               strval( $row->page_restrictions ) ) . "\n";
                }
                return $out;
        }