Niharika29 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/192798
Change subject: Don't let admin create a new campaign if one is already in
progress
......................................................................
Don't let admin create a new campaign if one is already in progress
Bug:T90604
Change-Id: I7965217f1ed0698a70b45df00495e72870262f19
---
M data/i18n/en.json
M data/i18n/qqq.json
M src/Controllers/Admin/Campaign.php
3 files changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/wikimedia/iegreview
refs/changes/98/192798/1
diff --git a/data/i18n/en.json b/data/i18n/en.json
index d329907..850b949 100644
--- a/data/i18n/en.json
+++ b/data/i18n/en.json
@@ -105,6 +105,7 @@
"admin-campaign-create-fail": "Campaign creation failed. Check logs.",
"admin-campaign-update-success": "Campaign updated.",
"admin-campaign-update-fail": "Error. Check logs.",
+ "admin-new-campaign-fail": "Cannot create a new campaign if one is
already in progress. Please end the current campaign before starting a new
one.",
"page-of-pages": "Page $1 of $2",
"no-results": "No results found",
diff --git a/data/i18n/qqq.json b/data/i18n/qqq.json
index 86ebc0a..55ac030 100644
--- a/data/i18n/qqq.json
+++ b/data/i18n/qqq.json
@@ -41,6 +41,7 @@
"admin-campaigns-start": "Input label, followed by textbox",
"admin-campaigns-end": "Input label, followed by textbox",
"admin-campaigns-id": "Table column header, ID of
campaign.\n{{Identical|ID}}",
+ "admin-new-campaign-fail": "Message shown to user when a new campaign
creation fails",
"change-password": "Navigation menu item, links to password change
page.\n{{Identical|Change password}}",
"credits": "Credits page heading",
diff --git a/src/Controllers/Admin/Campaign.php
b/src/Controllers/Admin/Campaign.php
index bbae914..7a222c1 100644
--- a/src/Controllers/Admin/Campaign.php
+++ b/src/Controllers/Admin/Campaign.php
@@ -66,7 +66,12 @@
'end_date' => $this->form->get( 'end_date' ),
);
- if ( $id == 'new' ) {
+ if ( $id == 'new' and $this->dao->activeCampaign() ) {
+ $this->flash( 'error',
+ $this->i18nContext->message(
'admin-new-campaign-fail' )
+ );
+ }
+ else if ( $id == 'new' ) {
// This is a temporary fix to make the *just
started* campaign active
// and bypass the actual start and end date
// to be fixed in a subsequent patch when
actual logic for using
--
To view, visit https://gerrit.wikimedia.org/r/192798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7965217f1ed0698a70b45df00495e72870262f19
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/iegreview
Gerrit-Branch: master
Gerrit-Owner: Niharika29 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits