Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/262697
Change subject: Use "origin-not-empty" as error code if "fromid" is not empty
......................................................................
Use "origin-not-empty" as error code if "fromid" is not empty
"target-not-empty" is a pretty obvious mistake
here as this is about the item that is going to
hold a redirect, not about the target of that
redirect.
Bug: T112238
Change-Id: I9e75b1d20f2081d45189889c2e906eda577a62a5
---
M repo/includes/Interactors/RedirectCreationInteractor.php
M repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/97/262697/1
diff --git a/repo/includes/Interactors/RedirectCreationInteractor.php
b/repo/includes/Interactors/RedirectCreationInteractor.php
index e6d0ac4..5c0e4de 100644
--- a/repo/includes/Interactors/RedirectCreationInteractor.php
+++ b/repo/includes/Interactors/RedirectCreationInteractor.php
@@ -176,7 +176,7 @@
if ( !$entity->isEmpty() ) {
throw new RedirectCreationException(
"Entity $entityId is not empty",
- 'target-not-empty'
+ 'origin-not-empty'
);
}
} catch ( RevisionedUnresolvedRedirectException $ex ) {
diff --git
a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
index fa9ae15..fa886b0 100644
--- a/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
+++ b/repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
@@ -177,7 +177,7 @@
'target is a redirect' => array( new ItemId( 'Q11' ),
new ItemId( 'Q22' ), 'target-is-redirect' ),
'target is incompatible' => array( new ItemId( 'Q11' ),
new PropertyId( 'P11' ), 'target-is-incompatible' ),
- 'source not empty' => array( new ItemId( 'Q12' ), new
ItemId( 'Q11' ), 'target-not-empty' ),
+ 'source not empty' => array( new ItemId( 'Q12' ), new
ItemId( 'Q11' ), 'origin-not-empty' ),
'can\'t redirect' => array( new PropertyId( 'P11' ),
new PropertyId( 'P12' ), 'cant-redirect' ),
'can\'t redirect EditFilter' => array( new ItemId(
'Q11' ), new ItemId( 'Q12' ), 'cant-redirect', Status::newFatal( 'EF' ) ),
);
--
To view, visit https://gerrit.wikimedia.org/r/262697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9e75b1d20f2081d45189889c2e906eda577a62a5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits