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

Change subject: Put status handling in EditPage into private function
......................................................................


Put status handling in EditPage into private function

This bit of code is isolated enough to be separated from
attemptSave and be put into a private function.

Change-Id: I84c532358ee32fec959039c62798e4de0702f14a
---
M includes/EditPage.php
1 file changed, 18 insertions(+), 2 deletions(-)

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



diff --git a/includes/EditPage.php b/includes/EditPage.php
index 9a68ab3..be350cb 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -1204,13 +1204,29 @@
         * @throws 
UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError
         * @return bool false if output is done, true if the rest of the form 
should be displayed
         */
-       function attemptSave() {
-               global $wgUser, $wgOut;
+       public function attemptSave() {
+               global $wgUser;
 
                $resultDetails = false;
                # Allow bots to exempt some edits from bot flagging
                $bot = $wgUser->isAllowed( 'bot' ) && $this->bot;
                $status = $this->internalAttemptSave( $resultDetails, $bot );
+
+               return $this->handleStatus( $status, $resultDetails );
+       }
+
+       /**
+        * Handle status, such as after attempt save
+        *
+        * @param Status $status
+        * @param array|bool $resultDetails
+        *
+        * @throws ErrorPageError
+        * return bool false, if output is done, true if rest of the form 
should be displayed
+        */
+       private function handleStatus( Status $status, $resultDetails ) {
+               global $wgUser, $wgOut;
+
                // FIXME: once the interface for internalAttemptSave() is made 
nicer, this should use the message in $status
                if ( $status->value == self::AS_SUCCESS_UPDATE || 
$status->value == self::AS_SUCCESS_NEW_ARTICLE ) {
                        $this->didSave = true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I84c532358ee32fec959039c62798e4de0702f14a
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to