Page MenuHomePhabricator

Mobile talk page editor fails if the talk page is a redirect
Closed, ResolvedPublic3 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

Details

Related Gerrit Patches:

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a project: Readers-Web-Backlog.
Jdlrobson moved this task to Incoming on the Readers-Web-Backlog board.
Jdlrobson added a subscriber: Jdlrobson.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 26 2015, 8:47 AM
Jdlrobson set Security to None.
Restricted Application added a project: Readers-Web-Backlog. · View Herald TranscriptAug 4 2015, 6:58 PM
Jdlrobson triaged this task as Low priority.Sep 9 2015, 8:06 PM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 27 2017, 8:05 PM
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)EditedMay 26 2017, 5:42 PM
Jdlrobson edited projects, added MediaWiki-API; removed patch-welcome, good first task.
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.

Jdlrobson updated the task description. (Show Details)May 26 2017, 6:39 PM

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)May 26 2017, 9:23 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Tgr added a comment.May 27 2017, 3:50 PM

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)May 30 2017, 4:30 PM
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.
Jdlrobson moved this task from Inbox to Next up on the User-Jdlrobson board.Nov 9 2017, 11:28 PM
Aklapper updated the task description. (Show Details)Dec 5 2017, 4:41 PM

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

eflyjason added a comment.EditedDec 26 2017, 2:45 AM

It seems that using redirect: true in Edit API in MobileFronted's TalkSectionOverlay solve the problem.

redirect: Automatically resolve redirects. 1.17+

Jdlrobson updated the task description. (Show Details)Jan 2 2018, 9:36 PM

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

Jdlrobson reassigned this task from eflyjason to phuedx.Jan 2 2018, 9:46 PM

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.

Jdlrobson moved this task from Next up to Done on the User-Jdlrobson board.Jan 3 2018, 10:47 PM
phuedx added a comment.Jan 4 2018, 6:43 PM

This LGTM. Thanks, @eflyjason!

phuedx closed this task as Resolved.Jan 4 2018, 6:43 PM