Revert "EditPage: Show EditFilterMergedContent hook errors in an errorbox"
authorPaladox <thomasmulhall410@yahoo.com>
Sat, 29 Oct 2016 21:51:27 +0000 (21:51 +0000)
committerReedy <reedy@wikimedia.org>
Wed, 2 Nov 2016 12:19:44 +0000 (12:19 +0000)
This reverts commit a02a7ff8eab9d589d77c03d4b4c58fc4a05e65c8.

Bug: T149473
Change-Id: I35a650c6ec478542351824e8ae8a8d8354ffa50f

includes/EditPage.php

index 4aa87d6..0f27e78 100644 (file)
@@ -1646,7 +1646,7 @@ class EditPage {
                                // being set. This is used by ConfirmEdit to display a captcha
                                // without any error message cruft.
                        } else {
-                               $this->hookError = $this->formatStatusErrors( $status );
+                               $this->hookError = $status->getWikiText();
                        }
                        // Use the existing $status->value if the hook set it
                        if ( !$status->value ) {
@@ -1656,7 +1656,7 @@ class EditPage {
                } elseif ( !$status->isOK() ) {
                        # ...or the hook could be expecting us to produce an error
                        // FIXME this sucks, we should just use the Status object throughout
-                       $this->hookError = $this->formatStatusErrors( $status );
+                       $this->hookError = $status->getWikiText();
                        $status->fatal( 'hookaborted' );
                        $status->value = self::AS_HOOK_ERROR_EXPECTED;
                        return false;
@@ -1665,26 +1665,6 @@ class EditPage {
                return true;
        }
 
-       /**
-        * Wrap status errors in an errorbox for increased visiblity
-        *
-        * @param Status $status
-        * @return string
-        */
-       private function formatStatusErrors( Status $status ) {
-               $errmsg = $status->getHTML(
-                       'edit-error-short',
-                       'edit-error-long',
-                       $this->context->getLanguage()
-               );
-               return <<<ERROR
-<div class="errorbox">
-{$errmsg}
-</div>
-<br clear="all" />
-ERROR;
-       }
-
        /**
         * Return the summary to be used for a new section.
         *