jenkins-bot has submitted this change and it was merged.
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.
DEPLOY: Consider writing a short note about this
to the wikidata mailing list.
Bug: T112238
Change-Id: I9e75b1d20f2081d45189889c2e906eda577a62a5
---
M repo/includes/Interactors/RedirectCreationInteractor.php
M repo/tests/phpunit/includes/Interactors/RedirectCreationInteractorTest.php
M repo/tests/phpunit/includes/api/CreateRedirectTest.php
3 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
JanZerebecki: Looks good to me, approved
jenkins-bot: Verified
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' ) ),
);
diff --git a/repo/tests/phpunit/includes/api/CreateRedirectTest.php
b/repo/tests/phpunit/includes/api/CreateRedirectTest.php
index b6ecc06..aa6f6c3 100644
--- a/repo/tests/phpunit/includes/api/CreateRedirectTest.php
+++ b/repo/tests/phpunit/includes/api/CreateRedirectTest.php
@@ -191,7 +191,7 @@
'target is a redirect' => array( 'Q11', 'Q22',
'target-is-redirect' ),
'target is incompatible' => array( 'Q11', 'P11',
'target-is-incompatible' ),
- 'source not empty' => array( 'Q12', 'Q11',
'target-not-empty' ),
+ 'source not empty' => array( 'Q12', 'Q11',
'origin-not-empty' ),
'can\'t redirect' => array( 'P11', 'P12',
'cant-redirect' ),
);
}
--
To view, visit https://gerrit.wikimedia.org/r/262697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9e75b1d20f2081d45189889c2e906eda577a62a5
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits