Page MenuHomePhabricator

Moving a Lexeme page should not be possible
Closed, ResolvedPublic3 Estimated Story Points

Description

Acceptance criteria

  • A user can not move Lexeme page

Scenarios

Scenario: No button on page

GIVEN I am logged in
WHEN I am on the Lexeme page
THEN there is no "Move" button in the navigation menu

Scenario: Deep-link protected

GIVEN the lexeme page exists
WHEN I give the page title as a parameter to Special:MovePage page
THEN I get the error message: You do not have permission to move this page, for the following reason: Cannot move pages in namespace "Lexeme".

For reference, the error happening when trying to move the item page

specialmove.png (291×579 px, 14 KB)

Scenario: API protected

GIVEN the lexeme page exists
WHEN I use API action=move to move it
THEN I get the error message

For reference this is what the API currently returns when trying to move an item:

https://test.wikidata.org/wiki/Special:ApiSandbox#action=move&format=json&from=Q123&to=Q29874184421&token=b8b4459e04b2cd62559f7f504e5356925aa7a796%2B%5C :

{
    "error": {
        "code": "immobile-source-namespace",
        "info": "Cannot move pages in namespace \"\".",
        "*": "See https://test.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw1340"
}

Event Timeline

WMDE-leszek created this task.
WMDE-leszek updated the task description. (Show Details)
WMDE-leszek updated the task description. (Show Details)
WMDE-leszek set the point value for this task to 3.

req

action:move
format:json
from:Lexeme:L2
to:Lexeme:L4711
token:...
{
    "error": {
        "code": "immobile-source-namespace",
        "info": "Cannot move pages in namespace \"Lexeme\".",
        "*": "See http://default.web.mw.localhost:8087/mediawiki/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "1b015798e086"
}

Is that good enough?

Addshore moved this task from To Do to Doing on the Wikidata-Turtles-18.03.28 board.
Addshore subscribed.

req

action:move
format:json
from:Lexeme:L2
to:Lexeme:L4711
token:...
{
    "error": {
        "code": "immobile-source-namespace",
        "info": "Cannot move pages in namespace \"Lexeme\".",
        "*": "See http://default.web.mw.localhost:8087/mediawiki/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "1b015798e086"
}

Is that good enough?

Looks good to me, I can try and write a test or 2

Change 424264 had a related patch set uploaded (by Addshore; owner: Addshore):
[mediawiki/extensions/WikibaseLexeme@master] Add test checking the moveability of Lexeme namespaces

https://gerrit.wikimedia.org/r/424264

I'm going to move this to peer review with this single simple test added.

I'm open to adding more tests, but I would argue that this functionality is / should be tested in core.
Right now core appears to do this for MovePage (in the form of MovePageTest) and it does check for the immobile-source-namespace.
The api (ApiMove) currently wraps MovePage, as does SpecialMovepage.

Change 424264 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Add test checking the moveability of Lexeme namespaces

https://gerrit.wikimedia.org/r/424264