Page MenuHomePhabricator

Special:ChangeContentModel should check if a page exists
Closed, ResolvedPublic

Description

Steps to reproduce
Go to Special:ChangeContentModel/User:Foo/page title that doesn't exist
Choose a new content model

Expected result:
Error, the title doesn't exist or
Confirmation of a desire to create the page with the content model

Actual result:
Page is created with the content model

Details

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

A confirmation is OK, but I don't see an issue with how it works currently. Before making it an error, there should be a way to create pages in alternate content models, which this functionality currently satisfies.

Before .json pages would be created in the JSON content model, I have created wikitext model pages with JSON content and then had them converted. If the JSON is not valid the content model change fails. The issue in the JSON would have been caught by the syntax checker had the page already been in the JSON content model when I added the content. Yes, it can be done by creating a blank page to convert, but is just an unnecessary step. (JSON is used as an example case.)

I don’t even think an extra confirmation is needed, but the form should make it clear by choosing appropriate wording (the heading should be Create a page with content model instead of Change content model of a page, the submit button should be Create rather than Change etc.).

Change #1270615 had a related patch set uploaded (by Pppery; author: Pppery):

[mediawiki/core@master] ChangeContentModel: Handle creating a new page in UI

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

I don’t even think an extra confirmation is needed, but the form should make it clear by choosing appropriate wording (the heading should be Create a page with content model instead of Change content model of a page, the submit button should be Create rather than Change etc.).

Unfortunately, I don't think that approach is going to work.

The problem is the Page title field:

image.png (1,158×370 px, 18 KB)

If you change the page title (should be page name but whatever) from one that exists to one that doesn't, the form would have to change and flip-flop back and forth.

You can't change the page title field mid-form; it's read-only in that screenshot.

You can't change the page title field mid-form; it's read-only in that screenshot.

I can confirm you are correct, so please ignore the previous comment.

Change #1270615 merged by jenkins-bot:

[mediawiki/core@master] ChangeContentModel: Handle creating a new page in UI

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