EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/204184
Change subject: Improve check to see if board is deleted
......................................................................
Improve check to see if board is deleted
Current check also matched non-existing board, causing
issues when trying to submit to brand new boards (where
title is being created as part of the first topic
submission)
This check will likely change with T90974, but should
probably suffice for now.
Change-Id: Iaa156adec026e2e592bf19e4afcf6f8b3017e19d
(cherry picked from commit 834aaac41cf7d6b1f5f9186c4178c4358a9c3f89)
---
M includes/Formatter/ContributionsQuery.php
M includes/RevisionActionPermissions.php
2 files changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/84/204184/1
diff --git a/includes/Formatter/ContributionsQuery.php
b/includes/Formatter/ContributionsQuery.php
index 1cbd1a2..1063ee1 100644
--- a/includes/Formatter/ContributionsQuery.php
+++ b/includes/Formatter/ContributionsQuery.php
@@ -73,8 +73,10 @@
try {
$result = $pager instanceof
ContribsPager ? new ContributionsRow : new DeletedContributionsRow;
$result = $this->buildResult(
$revision, $pager->getIndexField(), $result );
- // comparing article ID to 0 to check
if title is deleted
- $deleted =
$result->currentRevision->isDeleted() ||
$result->workflow->getOwnerTitle()->getArticleID() === 0;
+ // comparing article ID to 0 to check
if title doesn't currently
+ // exist & isDeleted to see if it ever
existed (but now deleted)
+ $title =
$result->workflow->getOwnerTitle();
+ $deleted =
$result->currentRevision->isDeleted() || ($title->getArticleID() === 0 &&
$title->isDeleted() > 0);
if (
$result instanceof
ContributionsRow &&
diff --git a/includes/RevisionActionPermissions.php
b/includes/RevisionActionPermissions.php
index 902b5f2..b79c276 100644
--- a/includes/RevisionActionPermissions.php
+++ b/includes/RevisionActionPermissions.php
@@ -82,8 +82,9 @@
$title = $workflow->getOwnerTitle();
// if the board is deleted, nothing is allowed
- // comparing article ID to 0 to check if title
is deleted
- $allowed = $title->getArticleID() !== 0 ||
$this->user->isAllowed( 'deletedhistory' );
+ // comparing article ID to 0 to check if title
doesn't currently
+ // exist & isDeleted to see if it ever existed
(but now deleted)
+ $allowed = $this->user->isAllowed(
'deletedhistory' ) || $title->getArticleID() !== 0 || $title->isDeleted() === 0;
}
} catch ( InvalidDataException $e ) {
// If data is not in storage, just return that
revision's status
--
To view, visit https://gerrit.wikimedia.org/r/204184
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa156adec026e2e592bf19e4afcf6f8b3017e19d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.26wmf1
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits