jenkins-bot has submitted this change and it was merged.

Change subject: (bug 66891) Disallow moving a Flow board
......................................................................


(bug 66891) Disallow moving a Flow board

We don't currently support that... :)

Bug: 66891
Change-Id: Ie1d09a4bec29d980eac1c1c00d4c884cd9b36b6c
---
M Flow.php
M Hooks.php
M i18n/en.json
M i18n/qqq.json
4 files changed, 21 insertions(+), 0 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Flow.php b/Flow.php
index d69fc9b..5d45bb0 100755
--- a/Flow.php
+++ b/Flow.php
@@ -332,6 +332,7 @@
 $wgHooks['WatchArticle'][] = 'FlowHooks::onWatchArticle';
 $wgHooks['UnwatchArticle'][] = 'FlowHooks::onWatchArticle';
 $wgHooks['CanonicalNamespaces'][] = 'FlowHooks::onCanonicalNamespaces';
+$wgHooks['AbortMove'][] = 'FlowHooks::onAbortMove';
 
 // Extension initialization
 $wgExtensionFunctions[] = 'FlowHooks::initFlowExtension';
diff --git a/Hooks.php b/Hooks.php
index c5b1b69..f8f629e 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -829,4 +829,22 @@
                return true;
        }
 
+       /**
+        * Moving a Flow page is not yet supported; make sure it can't be done.
+        *
+        * @param Title $oldTitle
+        * @param Title $newTitle
+        * @param User $user
+        * @param string|null $error Null coming in; assign (textual) error 
message when failing
+        * @param string $reason
+        * @return bool
+        */
+       public static function onAbortMove( $oldTitle, $newTitle, $user, 
&$error, $reason ) {
+               if ( self::$occupationController->isTalkpageOccupied( $oldTitle 
) ) {
+                       $error = wfMessage( 'flow-error-move' )->escaped();
+                       return false;
+               }
+
+               return true;
+       }
 }
diff --git a/i18n/en.json b/i18n/en.json
index b8bee45..95df349 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -141,6 +141,7 @@
     "flow-error-no-render": "The specified action was not recognized.",
     "flow-error-no-commit": "The specified action could not be saved.",
     "flow-error-fetch-after-open-close": "An error was encountered when 
requesting the new data. The open/close operation succeeded just fine, though. 
The error message was: $1",
+    "flow-error-move": "Moving a discussion board is currently not supported.",
     "flow-edit-header-placeholder": "Describe this Flow board",
     "flow-edit-header-submit": "Save header",
     "flow-edit-header-submit-overwrite": "Overwrite header",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 84ade6c..af9205c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -145,6 +145,7 @@
        "flow-error-no-render": "Error message when nothing was able to render 
the request (data was requested but it could not be processed).",
        "flow-error-no-commit": "Error message when nothing was able to commit 
the request (data was submitted but it could not be processed).",
        "flow-error-fetch-after-open-close": "Error message to be displayed 
when failing to request the new data after successfully performing open/close 
topic. This is meant to indicate to the user that some error was encountered, 
but that the open/close actually succeeded just fine - we just failed to get 
the new data to display the new status. Parameters:\n* $1 - The error message 
received.",
+       "flow-error-move": "Error message when attempting to move a flow board 
(which is not yet supported)",
        "flow-edit-header-placeholder": "Used as placeholder when editing the 
header of a Flow board",
        "flow-edit-header-submit": "Used as label for the Submit button.",
        "flow-edit-header-submit-overwrite": "Used as label for the Submit 
button, when submitting will overwrite a more recent change.",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie1d09a4bec29d980eac1c1c00d4c884cd9b36b6c
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: SG <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to