Georggi199 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328486 )

Change subject: Remove deprecated hooks
......................................................................

Remove deprecated hooks

Bug: T151973
Change-Id: I906a654054fef80b4646872f68df2c330cc40129
---
M GraphViz.php
M GraphViz_body.php
2 files changed, 3 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GraphViz 
refs/changes/86/328486/1

diff --git a/GraphViz.php b/GraphViz.php
index b559a95..1739841 100644
--- a/GraphViz.php
+++ b/GraphViz.php
@@ -109,20 +109,9 @@
        $GLOBALS['wgHooks']['OutputPageParserOutput'][] = 
'GraphViz::onOutputPageParserOutput';
        $GLOBALS['wgHooks']['ArticleDeleteComplete'][] = 
'GraphViz::onArticleDeleteComplete';
        $GLOBALS['wgHooks']['UnitTestsList'][] = 'GraphViz::onUnitTestsList';
-
-       $oldVersion = version_compare( $GLOBALS['wgVersion'], '1.21', '<' );
-       if ( $oldVersion ) {
-               # Do stuff for MediaWiki 1.20 and older
-               $GLOBALS['wgHooks']['ArticleSave'][] = 
'GraphViz::onArticleSave';
-               $GLOBALS['wgHooks']['ArticleSaveComplete'][] = 
'GraphViz::onArticleSaveComplete';
-               $GLOBALS['wgHooks']['EditPageGetPreviewText'][] = 
'GraphViz::onEditPageGetPreviewText';
-       } else {
-               # Do stuff for MediaWiki 1.21 and newer
-               $GLOBALS['wgHooks']['PageContentSave'][] = 
'GraphViz::onPageContentSave';
-               $GLOBALS['wgHooks']['PageContentSaveComplete'][] = 
'GraphViz::onPageContentSaveComplete';
-               $GLOBALS['wgHooks']['EditPageGetPreviewContent'][] = 
'GraphViz::onEditPageGetPreviewContent';
-       }
-
+       $GLOBALS['wgHooks']['PageContentSave'][] = 
'GraphViz::onPageContentSave';
+       $GLOBALS['wgHooks']['PageContentSaveComplete'][] = 
'GraphViz::onPageContentSaveComplete';
+       $GLOBALS['wgHooks']['EditPageGetPreviewContent'][] = 
'GraphViz::onEditPageGetPreviewContent';
        $GLOBALS['wgExtensionCredits']['parserhook'][] = array(
                'name' => 'Graphviz',
                'path' => __FILE__,
diff --git a/GraphViz_body.php b/GraphViz_body.php
index c27134c..b73a87e 100644
--- a/GraphViz_body.php
+++ b/GraphViz_body.php
@@ -420,16 +420,6 @@
        }
 
        /**
-        * Backwards-compatible (< MW 1.21) hook function front-end to 
GraphViz::initDummyFilePages for edit preview.
-        * initDummyFilePages() must be called before parsing for edit previews.
-        * @author Keith Welter
-        */
-       public static function onEditPageGetPreviewText( $editPage, &$toParse ) 
{
-               self::initDummyFilePages();
-               return true;
-       }
-
-       /**
         * When parsing is complete for a page, check for any graph image files 
associated with the page and
         * upload them.  The uploading must be deferred until this point 
because the upload code path
         * invokes parsing logic which throws an exception if called from a 
parser hook function.
@@ -658,15 +648,6 @@
        }
 
        /**
-        * Backwards-compatible (< MW 1.21) hook function front-end to 
GraphViz::onTitleSave.
-        * @author Keith Welter
-        */
-       public static function onArticleSave( &$article, &$user, &$text, 
&$summary, $minor, $watchthis, $sectionanchor, &$flags, &$status ) {
-               $title = $article->getTitle();
-               return self::onTitleSave( $title );
-       }
-
-       /**
         * Check if the given title text corresponds to a page that is being 
saved.
         * @author Keith Welter
         */
@@ -701,15 +682,6 @@
                wfDebug( __METHOD__ . ": done saving: $titleText\n" );
                unset( self::$titlesBeingSaved[$titleText] );
                return true;
-       }
-
-       /**
-        * Backwards-compatible (< MW 1.21) hook function front-end to 
GraphViz::onTitleSaveComplete.
-        * @author Keith Welter
-        */
-       public static function onArticleSaveComplete( &$article, &$user, $text, 
$summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, 
$baseRevId ) {
-               $title = $article->getTitle();
-               return self::onTitleSaveComplete( $title );
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/328486
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I906a654054fef80b4646872f68df2c330cc40129
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GraphViz
Gerrit-Branch: master
Gerrit-Owner: Georggi199 <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to