Mattflaschen has uploaded a new change for review.

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

Change subject: Show friendly error if no description on EnableFlow fresh 
creation
......................................................................

Show friendly error if no description on EnableFlow fresh creation

I reproduced this locally, but I believe it would also happen in
production (don't have rights to test there).

Bug: T108348
Change-Id: I6681ce540250fea4b069bcbf03d8122ccea6e081
---
M i18n/en.json
M i18n/qqq.json
M includes/Specials/SpecialEnableFlow.php
3 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/68/230368/1

diff --git a/i18n/en.json b/i18n/en.json
index 5cc371d..36203d3 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -393,6 +393,7 @@
        "flow-special-enableflow-board-already-exists": "There is already a 
Flow board at [[$1]].",
        "flow-special-enableflow-invalid-title": "An invalid page title was 
provided",
        "flow-special-enableflow-board-creation-not-allowed": "You are not 
allowed to create a Flow board at [[:$1]].",
+       "flow-special-enableflow-non-existent-requires-description": "To create 
a Flow board where no page currently exists, you must provide a description.",
        "flow-special-enableflow-page-is-liquidthreads": "There is a 
LiquidThreads page at [[:$1]].",
        "flow-special-enableflow-confirmation": "You have successfully created 
a Flow board at [[$1]].",
        "flow-conversion-archive-page-name-format": "%s/Archive 
%d\n%s/Archive%d\n%s/archive %d\n%s/archive%d",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ae7eee2..5aa0f8e 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -400,6 +400,7 @@
        "flow-special-enableflow-board-already-exists": "Error given on 
Special:EnableFlow if board already exists at requested page name.  
Parameters:\n$1 - Page name where user requested to put Flow board",
        "flow-special-enableflow-invalid-title": "Error given on 
Special:EnableFlow if the provided page is not a valid page name.",
        "flow-special-enableflow-board-creation-not-allowed": "Error given on 
Special:EnableFlow if the current user is not allowed to create a Flow board.  
Parameters:\n$1 - Page name where user requested to put Flow board",
+       "flow-special-enableflow-non-existent-requires-description": "Error 
given on Special:EnableFlow when page does not exist and no description is 
provided.",
        "flow-special-enableflow-page-is-liquidthreads": "Error given on 
Special:EnableFlow if the page to enable Flow on is a LiquidThreads page.  
Parameters:\n$1 - Page name where user requested to put Flow board",
        "flow-special-enableflow-confirmation": "Confirmation message on 
Special:EnableFlow saying that you have successfully created a board  
Parameters:\n$1 - Page name of new Flow board",
        "flow-conversion-archive-page-name-format": "Archive format used when 
enabling Flow on existing pages. This is a format string. %s and %d should be 
present. %s represents the title of the page where Flow is being enabled. %d 
represents a number that will be incremented if an archive page with the same 
name already exist. Multiple formats can be specified separated by the new line 
character (\\n).",
diff --git a/includes/Specials/SpecialEnableFlow.php 
b/includes/Specials/SpecialEnableFlow.php
index 9bcb9ea..8d22af9 100644
--- a/includes/Specials/SpecialEnableFlow.php
+++ b/includes/Specials/SpecialEnableFlow.php
@@ -109,6 +109,10 @@
                        }
 
                } else {
+                       if ( !isset( $data['header'] ) || $data['header'] === 
'' ) {
+                               return Status::newFatal( 
'flow-special-enableflow-non-existent-requires-description' );
+                       }
+
                        $allowCreationStatus = 
$this->occupationController->allowCreation( $title, $this->getUser(), false );
                        if ( !$allowCreationStatus->isGood() ) {
                                return Status::newFatal( 
'flow-special-enableflow-board-creation-not-allowed', $page );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6681ce540250fea4b069bcbf03d8122ccea6e081
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <mflasc...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to