Page MenuHomePhabricator

Mobile talk page editor fails if the talk page is a redirect
Closed, ResolvedPublic3 Estimated Story Points

Description

When I visit https://en.m.wikipedia.org/wiki/Module:ITN_candidate/image#/talk/2 and try to add a message I get the following error:

{"servedby":"mw1227","error":{"code":"nosuchsection","info":"There is no section 2.","*":"See https://en.wikipedia.org/w/api.php for API usage"}}

Using:

action:edit
format:json
title:Module talk:In the news/image
section:2
appendtext:

Developer notes

  • The talk overlay is not getting the canonical name of the talk page. It assumes it will be prefixed with Module talk which is not the case.
  • Instead of doing this we should probably ship the talk page name as a config variable using Title::getTalkPage (I'm surprised there wasn't one) or make use of new mw.Title(mw.config.values.wgTitle, mw.config.values.wgNamespaceNumber)

Testing criteria

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Web-Team-Backlog.
Jdlrobson moved this task to Incoming on the Web-Team-Backlog board.
Jdlrobson subscribed.
Jdlrobson raised the priority of this task from Low to Medium.May 21 2017, 1:15 PM

(This is a bug)

Jdlrobson updated the task description. (Show Details)
Jdlrobson added subscribers: Anomie, Tgr.

@Anomie @Tgr any idea why this bug may be being hit?

action:edit
format:json
title:Module talk:ITN candidate/image
section:2
appendtext:

Test ~~~~
token:******
{"error":{"code":"nosuchsection","info":"There is no section 2.","*":"See https://en.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1189"}

Seems like it may be a bug with the API?

No, it's not a bug with the API. The talk page in question is currently a redirect that has no section 2.

Ah so it's a redirect problem... thanks for enlightening me that wasn't too intuitive.
How the heck do we get the talk page title in JavaScript?! It's not available via the mw.Title api...

new mw.Title(mw.config.values.wgTitle, mw.config.values.wgNamespaceNumber )
Anomie renamed this task from Can't add items to module talk pages to Mobile talk page editor fails if the talk page is a redirect.May 26 2017, 8:27 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)

Ah so it's a redirect problem... thanks for enlightening me that wasn't too intuitive.
How the heck do we get the talk page title in JavaScript?! It's not available via the mw.Title api...

new mw.Title(mw.config.values.wgTitle, mw.config.values.wgNamespaceNumber )

Talk namespace is just subject namespace plus one (when it exists - not all namespaces have a talk namespace).

Jdlrobson updated the task description. (Show Details)
Jdlrobson set the point value for this task to 3.May 30 2017, 4:33 PM
Jdlrobson moved this task from Backlog to Bugs on the MinervaNeue board.

Is the main problem in skins/MinervaNeue/resources/skins.minerva.talk/init.js or other file?

Change 400203 had a related patch set uploaded (by Eflyjason; owner: Eflyjason):
[mediawiki/extensions/MobileFrontend@master] Fix mobile talk page editor fail when the talk page is a redirect

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

It seems that using [[ https://www.mediawiki.org/wiki/API:Edit | redirect: true ]] in Edit API in MobileFronted's TalkSectionOverlay solve the problem.

redirect: Automatically resolve redirects. 1.17+

Change 400203 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Fix mobile talk page editor failure when the talk page is a redirect

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

Since patch is merged, I've added to sprint. Sam, maybe you could take a second glance at this and sign off? I've added some criteria.