Page MenuHomePhabricator

Some MediaWiki API call examples show an empty result set due to hardcoded "Main Page" title
Open, LowPublic

Description

MediaWiki has gone and moved their "Main Page" to "MediaWiki". As a result of this, numerous API examples no longer work as originally intended. For example, clicking on the examples listed in the auto-documentation at https://www.mediawiki.org/wiki/API:Images , you will get an essentially empty result set, showing nothing of what the examples were intended to show.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 10 2019, 6:37 PM
Restricted Application added a project: Platform Engineering. · View Herald TranscriptOct 10 2019, 6:39 PM
Anomie triaged this task as Low priority.Oct 10 2019, 7:08 PM
Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.
Anomie added a subscriber: Anomie.

Someone could theoretically use Title::getMainPage(), but I'm not sure the extra complexity would really be worth it. Note that most of the time you'd also be needing to pass the main page title into the corresponding i18n message.

I hadn't actually thought to check that, Reedy. Oops! That's odd, though. I could swear most of the examples used to work. Did they maybe point to en-wiki or something? Or am I just remembering the old manual documentation? <shrug>

Aklapper renamed this task from API examples need updating to Some MediaWiki API call examples show an empty result set due to chosen query parameters.Oct 11 2019, 4:15 PM

You may have looked at them on enwiki or some other wiki where the main page is "Main Page". The old auto-generated documentation used the same examples as the current documentation does in almost all cases.

I just checked, and I'm thinking of the old manually documented examples (Template:ApiEx). They all pointed at enwiki. I finished the API portion of my project quite some time ago, so I haven't had much call to look at the live docs since then.

eprodromou added subscribers: srodlund, eprodromou.

@srodlund this is a problem for the automatically generated documentation.

I don't know if there's a way to fix that in the documentation. I'm also not sure that @Anomie 's suggestion would actually help with that documentation.

I see ~41 references to "Main Page" in the API self-documentation. This is a pretty good first bug to fix.

@srishakatux @Aklapper Let's take a look at this together. Might be a good GCI task?

Might be a good GCI task?

@srodlund: Could you explain what exactly is supposed from a contributor in this task? Somehow finding and editing about 41 wiki pages on mediawiki.org (by probably replacing something with something else)? Or something else? If I was a complete newcomer, what would I have to do?

@eprodromou: I've read this task several times now and it's still unclear to me what exactly I'd have to do where as a new contributor, so I'm removing good first task. Feel free to add this tag again if all criteria on https://phabricator.wikimedia.org/tag/good_first_bug/ is fulfilled and in the task desc - thanks! :)

Ammarpad claimed this task.Nov 27 2019, 9:56 AM
Ammarpad added a subscriber: Ammarpad.

I don't think this can be fixed on MediaWiki.org alone since it's automatically generated from the doc, so it needs to be fixed from the doc source which can be achieved by removing the hardcorded "Main Page" from the url and (probably) elsewhere in the i18n messages. For instance on apart from Mediawiki.org, on Wikidata, "Main Page" is a redlink

Someone could theoretically use Title::getMainPage(), but I'm not sure the extra complexity would really be worth it.

Please what else can be done to achieve the same result?

Note that most of the time you'd also be needing to pass the main page title into the corresponding i18n message.

Maybe that should not hardcode the value too

Ammarpad renamed this task from Some MediaWiki API call examples show an empty result set due to chosen query parameters to Some MediaWiki API call examples show an empty result set due to hardcorded "Main Page" title.Nov 27 2019, 9:57 AM
Ammarpad renamed this task from Some MediaWiki API call examples show an empty result set due to hardcorded "Main Page" title to Some MediaWiki API call examples show an empty result set due to hardcoded "Main Page" title.Nov 27 2019, 10:00 AM

Change 553795 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Get correct mainpage in API call examples

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