Page MenuHomePhabricator

Special:ChangeContentModel, with default content model, gives inaccurate edit summary and unnecessary log entry
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue:

  • Go to Special:ChangeContentModel
  • Create a new page with a default content model (e.g. wikitext in the main namespace)

What happens?:

The edit summary, and log entries for both new page log and content change model logs ALL say:

logentry-contentmodel-new": "$1 {{GENDER:$2|created}} the page $3 using a non-default content model \"$5\"",

where $3 is the name of the page and $5 is the name of the content model.

What should have happened instead?:

Separate system messages should be used:

  • logentry-contentmodel-new should be used for the content model change log only
  • The new page log should use the standard logentry-create-create not logentry-contentmodel-new.
  • The edit summary doesn't need to mention the name of the page, but should mention the new/old content models.

The wording of logentry-contentmodel-new could be simplified; articles the and an are not required in notation style - this would make it match other automatic summaries. Furthermore, using could be replaced by with.

Finally, it should probably note that it's a blank page in the edit summary (but not in the page log, where that's not important).

That gives as the standard edit summary:

Created blank page with non-default content model "$2"

However, if the default content model was used, then there seems little point in specifying that the user used the default, or logging anything in the change content log. i.e. just treat it like a normal page creation event. This is exactly what you get if you create a blank page via the normal &action=edit method.

The standard edit summary for creating a blank page comes from:

"autosumm-newblank": "Created blank page",

Log entry only for page creation log:

"logentry-create-create": "$1 {{GENDER:$2|created}} page $3",

The alternative of *only* allowing non-default content models in [[Special:ChangeContentModel]] seems a little bit silly.

I'm treating this as one bug, but the issues here could be patched separately if that simplifies things. It is a bit confusing.

Event Timeline

Bugreporter2 renamed this task from Special:CreateContentModel gives inaccurate edit summary with default content model to Special:CreateContentModel, with default content model, gives inaccurate edit summary and unnecessary log entry.Apr 17 2026, 12:22 PM
Bugreporter2 renamed this task from Special:CreateContentModel, with default content model, gives inaccurate edit summary and unnecessary log entry to Special:ChangeContentModel, with default content model, gives inaccurate edit summary and unnecessary log entry.
Bugreporter2 updated the task description. (Show Details)
Bugreporter2 updated the task description. (Show Details)

Hi, I reproduced this on a local MediaWiki 1.45.1 install and have a minimal fix ready. The issue is in includes/content/ContentModelChange.php, where new pages created via Special:ChangeContentModel always get treated as using a non-default model. My fix skips the contentmodel log entry and uses a normal blank-page summary when the selected model matches the page’s default model, while preserving current behavior for genuinely non-default models. I can prepare a Gerrit patch if this approach looks good.

Hi, I reproduced this on a local MediaWiki 1.45.1 install and have a minimal fix ready. The issue is in includes/content/ContentModelChange.php, where new pages created via Special:ChangeContentModel always get treated as using a non-default model. My fix skips the contentmodel log entry and uses a normal blank-page summary when the selected model matches the page’s default model, while preserving current behavior for genuinely non-default models. I can prepare a Gerrit patch if this approach looks good.

HI @Anirudh_KK,

I've tried to make the bug report as clear as possible. Your approach sounds good. If you care to upload your patch to Gerrit, I can probably persuade some people to review it.

Change #1275111 had a related patch set uploaded (by Anirudh_K; author: Anirudh_K):

[mediawiki/core@master] Fix incorrect edit summary and unnecessary log entry for default content model

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

Hi @Bugreporter2 ,
I have pushed a patch to address this issue. The fix ensures that when the default content model is used via Special:ChangeContentModel, it behaves like a normal page creation by avoiding unnecessary log entries and correcting the edit summary.
Kindly review the patch and share your feedback.

Thank you!

Frankly I'd be more inclined to let this edge case GIGO; you're doing something that doesn't make sense and there's no need to add more code, an extra message for translators to translate, etc.

The message can just say "$1 {{GENDER:$2|created}} the page $3 using content model \"$5\"" without requiring a second message.

I have pushed a new patchset to correct this issue. The fix ensures that when the default content model is used via Special:ChangeContentModel, it behaves like a normal page creation by avoiding unnecessary log entries and correcting the edit summary.
Kindly review the patch and share your feedback.

Thank you!
please review https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1275111/3

@Anirudh_KK have you tested the patch locally and can you post screenshots of your test? People are generally more willing to review patches if you can demonstrate they are working as you intended.

image.png (1,137×688 px, 48 KB)

image.png (1,144×529 px, 70 KB)

image.png (1,147×228 px, 80 KB)

@Bugreporter2 here is the screenshots of patch tested locally.

Pppery removed a project: Patch-For-Review.

I still think this was nothing but a waste of effort and we should have just not cared and let nonsensical results from nonsensical inputs. But whatever.