Page MenuHomePhabricator

Translatable edit summary comments not displaying on Special:NewPages
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

The edit summaries all begin with a string such as "wbeditentity-create-item:0|" or "wbeditentity-create:2|de".

What should have happened instead?:

The edit summaries should all begin with a string such as "নতুন একটি আইটেম তৈরি হয়েছে" in Bengali or "Created a new Item" in English (depending on the interface language).

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

This affects all entries in Special:NewPages when filtering for the Property, Lexeme, and EntitySchema namespaces as well. Special:RecentChanges and Special:Contributions both display the translated edit summary messages properly.

Event Timeline

I can reproduce it locally; reverting specials: Use batch to format comments on Special:NewPages resolves it.

It’s not immediately clear to me what the problem is; RowCommentFormatter is seemingly also used by ChangesList, which is used by RecentChanges and Watchlist, but those aren’t broken, so I don’t think Wikibase is fundamentally incompatible with RowCommentFormatter.

@Umherirrender and @tstarling: if I understand correctly, that change was just a refactoring; would it be okay to temporarily revert it until we’ve figured out how to make Wikibase work with it?

Okay, I figured out what the problem is, at least: the FormatAutocomments hook is now being called with a null $title, so we fall back to $wgTitle, see it’s a special page, and conclude that it’s not an entity page and therefore no autocomment formatting is necessary. The hook should be called with a $title corresponding to the new page of each row.

Change 965201 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/core@master] specials: Use correct title in NewPagesPager

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

Okay, and with that it wasn’t too hard to figure out the fix either. Might as well pull it into the kanban board then.

(I just wanted to give some helpful context about what Wikibase is doing here, but to find the right hook I had to use the debugger, and by the time I found the right place I had also noticed the $title difference ^^)

Change 965201 merged by jenkins-bot:

[mediawiki/core@master] specials: Use correct title in NewPagesPager

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

Change 965211 had a related patch set uploaded (by Jforrester; author: Lucas Werkmeister (WMDE)):

[mediawiki/core@wmf/1.41.0-wmf.30] specials: Use correct title in NewPagesPager

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

Change 965212 had a related patch set uploaded (by Jforrester; author: Lucas Werkmeister (WMDE)):

[mediawiki/core@REL1_41] specials: Use correct title in NewPagesPager

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

Change 965212 merged by jenkins-bot:

[mediawiki/core@REL1_41] specials: Use correct title in NewPagesPager

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

Change 965211 merged by jenkins-bot:

[mediawiki/core@wmf/1.41.0-wmf.30] specials: Use correct title in NewPagesPager

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

Mentioned in SAL (#wikimedia-operations) [2023-10-12T15:33:26Z] <lucaswerkmeister-wmde@deploy2002> Started scap: Backport for [[gerrit:965211|specials: Use correct title in NewPagesPager (T348665)]]

Mentioned in SAL (#wikimedia-operations) [2023-10-12T15:34:41Z] <lucaswerkmeister-wmde@deploy2002> jforrester and lucaswerkmeister-wmde: Backport for [[gerrit:965211|specials: Use correct title in NewPagesPager (T348665)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2023-10-12T15:42:33Z] <Lucas_WMDE> (mostly?) Finished scap: Backport for [[gerrit:965211|specials: Use correct title in NewPagesPager (T348665)]] (duration: 07m 13s) – scap failed in the purgeMessageBlobStore step (php-fpm-restarts finished)

Thanks for the fix, the call to RevisionRecord::getPageAsLinkTarget is a bit depther in the stack. The title provided to the RevisionRecord in the old code was created by Title::newFromRow, that function is using columns page_namespace and page_title from the database result. The fix is using rc_namespace and rc_title. In the most cases both are identically, only on page moves both could be differ.
In case of Wikibase there is no problem with that and I also see no problem for other usages on the hook (The title was added the first time in a44edf4a712ddac24dc4f58f7029febffaee3d3a).

Change 965556 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] specials: Use the new page name for comment formatting

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

In case of Wikibase there is no problem with that and I also see no problem for other usages on the hook (The title was added the first time in a44edf4a712ddac24dc4f58f7029febffaee3d3a).

I have found a (relevant) use case and uploaded a patch set for it.

Change 965556 merged by jenkins-bot:

[mediawiki/core@master] specials: Use the new page name for comment formatting

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