EditPage: Fix display of errors with multiple messages
authorKunal Mehta <legoktm@member.fsf.org>
Wed, 17 Aug 2016 05:59:14 +0000 (22:59 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 17 Aug 2016 05:59:14 +0000 (22:59 -0700)
If a status object returns failure with multiple messages (like in
Content::prepareSave()), then previously the first list item would have
a raw asterisk in front of it instead of being a list item because the
<div> tag was on the same line. Adding a newline before the status
object's wikitext will ensure that the first item is interpreted as part
of the list.

Change-Id: If42b3e745f1bd57c6e7964c8e297dab2bf742d4c

includes/EditPage.php

index ee06993..9b862b9 100644 (file)
@@ -1474,7 +1474,7 @@ class EditPage {
 
                        case self::AS_CANNOT_USE_CUSTOM_MODEL:
                        case self::AS_PARSE_ERROR:
-                               $wgOut->addWikiText( '<div class="error">' . $status->getWikiText() . '</div>' );
+                               $wgOut->addWikiText( '<div class="error">' . "\n" . $status->getWikiText() . '</div>' );
                                return true;
 
                        case self::AS_SUCCESS_NEW_ARTICLE:
@@ -1551,7 +1551,7 @@ class EditPage {
                                // is if an extension hook aborted from inside ArticleSave.
                                // Render the status object into $this->hookError
                                // FIXME this sucks, we should just use the Status object throughout
-                               $this->hookError = '<div class="error">' . $status->getWikiText() .
+                               $this->hookError = '<div class="error">' ."\n" . $status->getWikiText() .
                                        '</div>';
                                return true;
                }