From: Sam Reed Date: Thu, 18 Aug 2011 23:37:04 +0000 (+0000) Subject: * (bug 30450) Clear page_props table on page deletion X-Git-Tag: 1.31.0-rc.0~28179 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=afa82f68b2acac75d63e91de3968a4ae4b6a4266;p=lhc%2Fweb%2Fwiklou.git * (bug 30450) Clear page_props table on page deletion Also clear them on a move over redirect Modified delete() calls in doDeleteArticle to pass __METHOD__ for the function name --- diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 4f144872bb..1dd5103869 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -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 diff --git a/includes/Title.php b/includes/Title.php index f9a61e64d2..29f292e828 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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', diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 47632c05de..dbff4d8521 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -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