Pwirth has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354395 )

Change subject: BSShoutBox: Fixed / impoved error handling
......................................................................

BSShoutBox: Fixed / impoved error handling

Change-Id: I9eb3bbed1d20580a67af8fd9f07ce6a4a0e48488
---
M ShoutBox/i18n/qqq.json
M ShoutBox/includes/api/BSApiTasksShoutBox.php
2 files changed, 15 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/95/354395/1

diff --git a/ShoutBox/i18n/qqq.json b/ShoutBox/i18n/qqq.json
index 6b73ca3..0256b08 100644
--- a/ShoutBox/i18n/qqq.json
+++ b/ShoutBox/i18n/qqq.json
@@ -38,5 +38,6 @@
        "bs-shoutbox-notifications-title-message-text": "text used in 
notifications in the wiki and as the mail body if the user was mentioned in a 
shoutbox entry\n\nParameters:\n*$1 is the username of the user who mentioned 
\n*$2 is the page title where shoutbox entry was made. \n*$3 is the link to the 
page where the shoutbox entry was made. \n*$4 is the link to profile of the 
user who mentioned. \n*$5 is the page title where shoutbox entry was made.",
        "bs-shoutbox-notifications-summary": "Text used in notifications about 
the mentioning of an user in a shoutbox message.\n\nParameters:\n*$1 the user 
who mentioned \n*$2 is the link to the user page of the user that mentioned 
another user. (unused) \n*$3 is the link to the page where the shoutbox entry 
was made.\n*$4 is the real name of the user who mentioned. (unused)\n*$5 is the 
title of the page where the shoutbox entry was made. (unused)",
        "apihelp-bs-shoutbox-tasks-description": "Describes an API endpoint 
that provides common tasks for the 
ShoutBox\n{{doc-apihelp-description|bs-shoutbox-tasks}}",
-       "bs-usagetracker-shoutbox": "Name of the descriptor used in 
[[Special:UsageTracker|Special:UsageTracker]] output"
+       "bs-usagetracker-shoutbox": "Name of the descriptor used in 
[[Special:UsageTracker|Special:UsageTracker]] output",
+       "bs-shoutbox-error-noarticleid": "Error message in api when the 
parameter articleId was not given or empty"
 }
diff --git a/ShoutBox/includes/api/BSApiTasksShoutBox.php 
b/ShoutBox/includes/api/BSApiTasksShoutBox.php
index 5c25af7..36ea3b0 100644
--- a/ShoutBox/includes/api/BSApiTasksShoutBox.php
+++ b/ShoutBox/includes/api/BSApiTasksShoutBox.php
@@ -138,6 +138,9 @@
                $oReturn->payload['html'] = '';
 
                if( $iArticleId < 1 ) {
+                       $oReturn->message = wfMessage(
+                               'bs-shoutbox-error-noarticleid'
+                       )->plain();
                        return $oReturn;
                }
 
@@ -277,6 +280,9 @@
                ;
                // TODO MRG (08.09.10 01:57): error message
                if ( $iArticleId <= 0 ) {
+                       $oReturn->message = wfMessage(
+                               'bs-shoutbox-error-noarticleid'
+                       )->plain();
                        return $oReturn;
                }
                $sMessage = isset( $oTaskData->message )
@@ -293,6 +299,12 @@
                                0,
                                BsConfig::get( 'MW::ShoutBox::MaxMessageLength' 
)
                        );
+               }
+               if( empty( $sMessage ) ) {
+                       $oReturn->message = wfMessage(
+                               'bs-shoutbox-entermessage'
+                       )->plain();
+                       return $oReturn;
                }
 
                $oDB = wfGetDB( DB_MASTER );
@@ -396,7 +408,7 @@
                        'bs-shoutbox-archive-success'
                )->plain();
                $this->runUpdates();
-
+               $oReturn->success = true;
                return $oReturn;
        }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9eb3bbed1d20580a67af8fd9f07ce6a4a0e48488
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Pwirth <wi...@hallowelt.biz>

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

Reply via email to