Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315115

Change subject: Replace ArticleSaveComplete hook usage
......................................................................

Replace ArticleSaveComplete hook usage

Bug: T147561
Change-Id: Iaa9b5503cf63954b959fe82b91d3f6aa97873453
---
M ArticleInfo/ArticleInfo.class.php
M ExtendedSearch/ExtendedSearch.class.php
M PageAssignments/extension.json
M PageAssignments/includes/PageAssignmentsNotificationHooks.php
M SaferEdit/SaferEdit.class.php
M SmartList/SmartList.class.php
M WantedArticle/WantedArticle.class.php
7 files changed, 20 insertions(+), 20 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/15/315115/1

diff --git a/ArticleInfo/ArticleInfo.class.php 
b/ArticleInfo/ArticleInfo.class.php
index 4ecf0dd..06b87b6 100644
--- a/ArticleInfo/ArticleInfo.class.php
+++ b/ArticleInfo/ArticleInfo.class.php
@@ -59,7 +59,7 @@
                $this->setHook( 'BSStateBarBeforeBodyViewAdd', 
'onStateBarBeforeBodyViewAdd' );
                $this->setHook( 'BsAdapterAjaxPingResult' );
 
-               $this->setHook( 'ArticleSaveComplete' );
+               $this->setHook( 'PageContentSaveComplete' );
                $this->setHook( 'ArticleDeleteComplete' );
                $this->setHook( 'BeforePageDisplay');
 
@@ -543,7 +543,7 @@
         * Hook-Handler for Mediawiki hook ArticleDeleteComplete
         * @param Article $article
         * @param User $user
-        * @param string $text
+        * @param string $content Content
         * @param string $summary
         * @param integer $minoredit
         * @param type $watchthis
@@ -554,7 +554,7 @@
         * @param integer $baseRevId
         * @return boolean - always true
         */
-       public function onArticleSaveComplete( &$article, &$user, $text, 
$summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, 
$baseRevId ) {
+       public function onPageContentSaveComplete( &$article, &$user, $content, 
$summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, 
$baseRevId ) {
                if( $status->value['new'] === false ) return true;
 
                $oTitle = $article->getTitle();
diff --git a/ExtendedSearch/ExtendedSearch.class.php 
b/ExtendedSearch/ExtendedSearch.class.php
index a3a875f..c9e6bd0 100644
--- a/ExtendedSearch/ExtendedSearch.class.php
+++ b/ExtendedSearch/ExtendedSearch.class.php
@@ -96,7 +96,7 @@
                BsConfig::registerVar( 'MW::ExtendedSearch::MltNS', array( 0 ), 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_ARRAY_INT|BsConfig::USE_PLUGIN_FOR_PREFS, 
'bs-extendedsearch-pref-mltns', 'multiselectex' );
 
                // Hooks
-               $this->setHook( 'ArticleSaveComplete' );
+               $this->setHook( 'PageContentSaveComplete' );
                $this->setHook( 'ArticleDeleteComplete' );
                $this->setHook( 'ArticleUndelete' );
                $this->setHook( 'TitleMoveComplete' );
@@ -384,7 +384,7 @@
         * @param string $sText New text.
         * @return bool allow other hooked methods to be executed. Always true.
         */
-       public function onArticleSaveComplete( &$oArticle, &$oUser ) {
+       public function onPageContentSaveComplete( &$oArticle, &$oUser ) {
                try {
                        BuildIndexMainControl::getInstance()->updateIndexWiki( 
$oArticle );
                        $oTitle = $oArticle->getTitle();
diff --git a/PageAssignments/extension.json b/PageAssignments/extension.json
index 085ec99..a4f854c 100644
--- a/PageAssignments/extension.json
+++ b/PageAssignments/extension.json
@@ -174,7 +174,7 @@
                "BSStatebarAddSortTopVars": 
"PageAssignmentsStateBarHooks::onStatebarAddSortTopVars",
                "BSStatebarAddSortBodyVars": 
"PageAssignmentsStateBarHooks::onStatebarAddSortBodyVars",
                "BSWikiAdminMenuItems": 
"PageAssignmentsHooks::onBSWikiAdminMenuItems",
-               "ArticleSaveComplete": 
"PageAssignmentsNotificationHooks::onArticleSaveComplete",
+               "PageContentSaveComplete": 
"PageAssignmentsNotificationHooks::onPageContentSaveComplete",
                "BSUserManagerAfterSetGroups": 
"PageAssignmentsNotificationHooks::onBSUserManagerAfterSetGroups",
                "UserAddGroup": 
"PageAssignmentsUsersAdditionalPermissionsHooks::onUserAddGroup",
                "userCan": 
"PageAssignmentsUsersAdditionalPermissionsHooks::onUserCan",
diff --git a/PageAssignments/includes/PageAssignmentsNotificationHooks.php 
b/PageAssignments/includes/PageAssignmentsNotificationHooks.php
index 93c6bc8..8b9c0de 100644
--- a/PageAssignments/includes/PageAssignmentsNotificationHooks.php
+++ b/PageAssignments/includes/PageAssignmentsNotificationHooks.php
@@ -147,7 +147,7 @@
         *
         * @param Article $article
         * @param user $user
-        * @param string $text
+        * @param string $content Content
         * @param string $summary
         * @param bool $minoredit
         * @param bool $watchthis
@@ -158,7 +158,7 @@
         * @param int $baseRevId
         * @return boolean
         */
-       public static function onArticleSaveComplete( &$article, &$user, $text, 
$summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, 
$baseRevId ) {
+       public static function onPageContentSaveComplete( &$article, &$user, 
$content, $summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, 
&$status, $baseRevId ) {
                PageAssignmentsNotificationHooks::notify( 
'bs-pageassignments-page-edit', $user, $article->getTitle() );
                return true;
        }
diff --git a/SaferEdit/SaferEdit.class.php b/SaferEdit/SaferEdit.class.php
index 8110b49..1f6ce0d 100644
--- a/SaferEdit/SaferEdit.class.php
+++ b/SaferEdit/SaferEdit.class.php
@@ -50,7 +50,7 @@
                BsConfig::registerVar( 'MW::SaferEdit::ShowNameOfEditingUser', 
true, 
BsConfig::LEVEL_PUBLIC|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 
'bs-saferedit-pref-shownameofeditinguser', 'toggle' );
                BsConfig::registerVar( 'MW::SaferEdit::WarnOnLeave', true, 
BsConfig::LEVEL_USER|BsConfig::TYPE_BOOL|BsConfig::RENDER_AS_JAVASCRIPT, 
'bs-saferedit-pref-warnonleave', 'toggle' );
 
-               $this->setHook( 'ArticleSaveComplete', 'clearSaferEdit' );
+               $this->setHook( 'PageContentSaveComplete', 'clearSaferEdit' );
                $this->setHook( 'EditPage::showEditForm:initial', 
'setEditSection' );
                $this->setHook( 'BSStateBarAddSortTopVars', 
'onStatebarAddSortTopVars' );
                $this->setHook( 'BSStateBarBeforeTopViewAdd', 
'onStateBarBeforeTopViewAdd' );
@@ -112,10 +112,10 @@
 
        /**
         * Clear all previously saved intermediate edits when article is saved
-        * Called by ArticleSaveComplete hook
+        * Called by PageContentSaveComplete hook
         * @param Article $article The article that is created.
         * @param User $user User that saved the article.
-        * @param string $text New text.
+        * @param string $content Content
         * @param string $summary Edit summary.
         * @param bool $minoredit Marked as minor.
         * @param bool $watchthis Put on watchlist.
@@ -124,7 +124,7 @@
         * @param Revision $revision New revision object.
         * @return bool true do let other hooked methods be executed
         */
-       public function clearSaferEdit( $article, $user, $text, $summary, 
$minoredit, $watchthis, $sectionanchor, $flags, $revision ) {
+       public function clearSaferEdit( $article, $user, $content, $summary, 
$minoredit, $watchthis, $sectionanchor, $flags, $revision ) {
                $this->doClearSaferEdit( $user->getName(), 
$article->getTitle()->getDbKey(), $article->getTitle()->getNamespace() );
                return true;
        }
diff --git a/SmartList/SmartList.class.php b/SmartList/SmartList.class.php
index 5114439..c4695e5 100644
--- a/SmartList/SmartList.class.php
+++ b/SmartList/SmartList.class.php
@@ -46,7 +46,7 @@
        protected function initExt() {
                wfProfileIn('BS::' . __METHOD__);
                $this->setHook( 'ParserFirstCallInit', 'onParserFirstCallInit' 
);
-               $this->setHook( 'ArticleSaveComplete' );
+               $this->setHook( 'PageContentSaveComplete' );
                $this->setHook( 'BSWidgetBarGetDefaultWidgets' );
                $this->setHook( 'BSWidgetListHelperInitKeyWords' );
                $this->setHook( 'BSUserSidebarDefaultWidgets' );
@@ -369,7 +369,7 @@
         * Purges aricle cache on save when smartlist tag is present.
         * @param Article $article The article that is created.
         * @param User $user User that saved the article.
-        * @param string $text New text.
+        * @param string $content Content
         * @param string $summary Edit summary.
         * @param bool $minoredit Marked as minor.
         * @param bool $watchthis Put on watchlist.
@@ -381,8 +381,8 @@
         * @param bool $redirect Redirect user back to page after edit (since 
MW1.17)
         * @return bool allow other hooked methods to be executed. Always true
         */
-       public function onArticleSaveComplete( &$article, &$user, $text, 
$summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, 
$baseRevId ) {
-               if ( stripos( $text, "smartlist" ) || stripos( $text, "infobox" 
) ) {
+       public function onPageContentSaveComplete( &$article, &$user, $content, 
$summary, $minoredit, $watchthis, $sectionanchor, &$flags, $revision, &$status, 
$baseRevId ) {
+               if ( stripos( $content, "smartlist" ) || stripos( $content, 
"infobox" ) ) {
                        $article->doPurge();
                }
                return true;
diff --git a/WantedArticle/WantedArticle.class.php 
b/WantedArticle/WantedArticle.class.php
index 7a92c69..5f32693 100644
--- a/WantedArticle/WantedArticle.class.php
+++ b/WantedArticle/WantedArticle.class.php
@@ -46,7 +46,7 @@
        protected function initExt() {
                wfProfileIn( 'BS::WantedArticle::initExt' );
                $this->setHook( 'ParserFirstCallInit' );
-               $this->setHook( 'ArticleSaveComplete' );
+               $this->setHook( 'PageContentSaveComplete' );
                $this->setHook( 'BSExtendedSearchAdditionalActions' );
                $this->setHook( 'BSWidgetBarGetDefaultWidgets' );
                $this->setHook( 'BSWidgetListHelperInitKeyWords' );
@@ -197,10 +197,10 @@
        }
 
        /**
-        * Hook-Handler for MediaWiki 'ArticleSaveComplete' hook. Removes an 
article from wishlist when created.
+        * Hook-Handler for MediaWiki 'PageContentSaveComplete' hook. Removes 
an article from wishlist when created.
         * @param Article $oArticle Article modified
         * @param User $oUser User performing the modification
-        * @param string $sText New content
+        * @param string $sContent Content
         * @param string $sSummary Edit summary/comment
         * @param bool $bIsMinor Whether or not the edit was marked as minor
         * @param bool $bIsWatch (No longer used)
@@ -211,7 +211,7 @@
         * @param mixed $vBaseRevId the rev ID (or false) this edit was based on
         * @return bool Always true to keep hooks running.
         */
-       public function onArticleSaveComplete( $oArticle, $oUser, $sText, 
$sSummary, $bIsMinor, $bIsWatch, $iSection, $vFlags, $oRevision, $oStatus, 
$vBaseRevId ) {
+       public function onPageContentSaveComplete( $oArticle, $oUser, 
$sContent, $sSummary, $bIsMinor, $bIsWatch, $iSection, $vFlags, $oRevision, 
$oStatus, $vBaseRevId ) {
                if( $oArticle->getTitle()->equals( 
$this->getDataSourceTemplateArticle()->getTitle() ) ) {
                        BsCacheHelper::invalidateCache( 
BsCacheHelper::getCacheKey( 'BlueSpice', 'WantedArticle', 
$oArticle->getTitle()->getPrefixedText() ) );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa9b5503cf63954b959fe82b91d3f6aa97873453
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>

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

Reply via email to