Page MenuHomePhabricator

Investigate cross-wiki normalization of page titles in CampaignEvents for event contributions
Open, Needs TriagePublic

Description

Problem

DB key and prefixedText are separate concepts and cannot be used interchangeably when working with page titles.
For local pages, a title formatter could handle this, but for cross-wiki cases this approach does not work.

    1. Proposed solution
  • Investigate whether there is an existing helper in:
    • WikiMap
    • MediaWikiSite
    • WikiReference
    • MediaWikiPageNameNormalizer

      that can normalize/format page titles across wikis.
  • If no suitable helper exists, explore the alternative of using a manual API request (see CheckUser patch 1083383).
  • Document and implement the appropriate approach so that CampaignEvents can properly handle cross-wiki page title normalization.
    1. References
  • Discussion with Daimona (Sep 2025) about separating DB key and prefixedText.
  • Identified as part of the broader *"can we make this work cross-wiki"* subject.
  • Claudio fixed a related issue, but this part was deferred into its own task.

Acceptance criteria

  • Given a user is associating an edit with an event using the API
    • And the edit was made on another wiki
      • Then the edited page's title is correctly formatted in the contributions tab, according to the configuration of the other wiki (w.r.t, for example, custom namespaces and namespace translations)

Event Timeline

Change #1192188 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/CampaignEvents@master] [WIP] Resolve foreign titles

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

Change #1192188 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] EventContribution: properly format foreign titles

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

Keeping this in QA until I can test on betacluster

Test wiki created on Patch demo by MHorsey-WMF using patch(es) linked to this task:
https://82f35f84e6.catalyst.wmcloud.org/w/

Given a user is associating an edit with an event using the API
And the edit was made on another wiki
❌ Then the edited page's title is correctly formatted in the contributions tab, according to the configuration of the other wiki (w.r.t, for example, custom namespaces and namespace translations)

@cmelo I am able to correctly associate an event with an edit that is on a different wiki through the API, but then those edits do not show in my collaborative contribution table. I have associated edits on arwiki, eswiki, and dewiki with an event that i created on enwiki, but none of the edits display on the collaborative contributions table.

Screen Recording 2025-11-17 at 1.29.29 PM.gif (1×3 px, 2 MB)

However, when I associate an edit with an event on a different wiki using the UI instead of using directly using the API, then it does display the edited page's title as correctly formatted in the contributions tab, in the wiki of the event:

Screenshot 2025-11-17 at 1.36.46 PM.png (1×2 px, 282 KB)

So... since this ticket is for the API, it doesn't seem to be working correctly, even though I am getting a success message from the API. But when I use the UI, it is working correctly, and page titles are correctly formatted in the collaborative contributions table. Thoughts? I have been testing using this event: https://en.wikipedia.beta.wmcloud.org/wiki/Special:EventDetails/1265 and all contributions that are displaying were created using the UI.

I am able to correctly associate an event with an edit that is on a different wiki through the API, but then those edits do not show in my collaborative contribution table. I have associated edits on arwiki, eswiki, and dewiki with an event that i created on enwiki, but none of the edits display on the collaborative contributions table.

That is a different issue, most likely T410327 which I just filed.

So... since this ticket is for the API, it doesn't seem to be working correctly, even though I am getting a success message from the API. But when I use the UI, it is working correctly, and page titles are correctly formatted in the collaborative contributions table. Thoughts? I have been testing using this event: https://en.wikipedia.beta.wmcloud.org/wiki/Special:EventDetails/1265 and all contributions that are displaying were created using the UI.

If title normalization is correct, I think that's enough for this task. I'll take care of the error in the other task.

I am able to correctly associate an event with an edit that is on a different wiki through the API, but then those edits do not show in my collaborative contribution table. I have associated edits on arwiki, eswiki, and dewiki with an event that i created on enwiki, but none of the edits display on the collaborative contributions table.

That is a different issue, most likely T410327 which I just filed.

So... since this ticket is for the API, it doesn't seem to be working correctly, even though I am getting a success message from the API. But when I use the UI, it is working correctly, and page titles are correctly formatted in the collaborative contributions table. Thoughts? I have been testing using this event: https://en.wikipedia.beta.wmcloud.org/wiki/Special:EventDetails/1265 and all contributions that are displaying were created using the UI.

If title normalization is correct, I think that's enough for this task. I'll take care of the error in the other task.

Sounds good, sending to product sign off

Screenshot 2025-11-17 at 6.15.32 PM.png (636×2 px, 214 KB)