* (bug 30450) Clear page_props table on page deletion
authorSam Reed <reedy@users.mediawiki.org>
Thu, 18 Aug 2011 23:37:04 +0000 (23:37 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 18 Aug 2011 23:37:04 +0000 (23:37 +0000)
Also clear them on a move over redirect

Modified delete() calls in doDeleteArticle to pass __METHOD__ for the function name

RELEASE-NOTES-1.19
includes/Title.php
includes/WikiPage.php

index 4f14487..1dd5103 100644 (file)
@@ -44,6 +44,7 @@ production.
   language. In theory this sets the right magic words in system messages,
   although they are not used there.
 * (bug 30451) Add page_props to RefreshLinks::deleteLinksFromNonexistent
+* (bug 30450) Clear page_props table on page deletion
 
 === Bug fixes in 1.19 ===
 * $wgUploadNavigationUrl should be used for file redlinks if
index f9a61e6..29f292e 100644 (file)
@@ -839,12 +839,12 @@ class Title {
 
                # Hand off all the decisions on urls to getLocalURL
                $url = $this->getLocalURL( $query, $variant );
-               
+
                # Expand the url to make it a full url. Note that getLocalURL has the
                # potential to output full urls for a variety of reasons, so we use
                # wfExpandUrl instead of simply prepending $wgServer
                $url = wfExpandUrl( $url, PROTO_RELATIVE );
-               
+
                # Finally, add the fragment.
                $url .= $this->getFragmentForURL();
 
@@ -923,7 +923,7 @@ class Title {
                                        $url = "{$wgScript}?title={$dbkey}&{$query}";
                                }
                        }
-                       
+
                        wfRunHooks( 'GetLocalURL::Internal', array( &$this, &$url, $query, $variant ) );
 
                        // @todo FIXME: This causes breakage in various places when we
@@ -1930,7 +1930,7 @@ class Title {
 
        /**
         * Does that page contain wikitext, or it is JS, CSS or whatever?
-        * 
+        *
         * @return Bool
         */
        public function isWikitextPage() {
@@ -3306,6 +3306,7 @@ class Title {
                                $dbw->delete( 'externallinks', array( 'el_from' => $newid ), __METHOD__ );
                                $dbw->delete( 'langlinks', array( 'll_from' => $newid ), __METHOD__ );
                                $dbw->delete( 'redirect', array( 'rd_from' => $newid ), __METHOD__ );
+                               $dbw->delete( 'page_props', array( 'pp_page' => $newid ), __METHOD__ );
                        }
                        // If the target page was recently created, it may have an entry in recentchanges still
                        $dbw->delete( 'recentchanges',
index 47632c0..dbff4d8 100644 (file)
@@ -1695,18 +1695,20 @@ class WikiPage extends Page {
                if ( !$dbw->cascadingDeletes() ) {
                        $dbw->delete( 'revision', array( 'rev_page' => $id ), __METHOD__ );
 
-                       if ( $wgUseTrackbacks )
+                       if ( $wgUseTrackbacks ) {
                                $dbw->delete( 'trackbacks', array( 'tb_page' => $id ), __METHOD__ );
+                       }
 
                        # Delete outgoing links
-                       $dbw->delete( 'pagelinks', array( 'pl_from' => $id ) );
-                       $dbw->delete( 'imagelinks', array( 'il_from' => $id ) );
-                       $dbw->delete( 'categorylinks', array( 'cl_from' => $id ) );
-                       $dbw->delete( 'templatelinks', array( 'tl_from' => $id ) );
-                       $dbw->delete( 'externallinks', array( 'el_from' => $id ) );
-                       $dbw->delete( 'langlinks', array( 'll_from' => $id ) );
-                       $dbw->delete( 'iwlinks', array( 'iwl_from' => $id ) );
-                       $dbw->delete( 'redirect', array( 'rd_from' => $id ) );
+                       $dbw->delete( 'pagelinks', array( 'pl_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'imagelinks', array( 'il_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'categorylinks', array( 'cl_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'templatelinks', array( 'tl_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'externallinks', array( 'el_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'langlinks', array( 'll_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'iwlinks', array( 'iwl_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'redirect', array( 'rd_from' => $id ), __METHOD__ );
+                       $dbw->delete( 'page_props', array( 'pp_page' => $id ), __METHOD__ );
                }
 
                # If using cleanup triggers, we can skip some manual deletes