Page MenuHomePhabricator

Specifying an invalid section with action=edit doesn't throw a nosuchsection error
Closed, ResolvedPublic

Description

Was writing tests for testEditSection and noticed this...

Setting &section=300 on [[User:Legoktm]] (no sections at all) returns:

{

"edit": {
    "result": "Success",
    "pageid": 14989378,
    "title": "User:Legoktm",
    "contentmodel": "wikitext",
    "nochange": ""
}

}

It should have thrown an error of "nosuchsection".


Version: 1.22.0
Severity: normal
URL: https://en.wikipedia.org/wiki/Special:ApiSandbox#action=edit&format=json&title=User%3ALegoktm&section=300&text=test&token=&summary=blahblah

Details

Reference
bz53884

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:58 AM
bzimport set Reference to bz53884.
bzimport added a subscriber: Unknown Object (MLST).

I'm not entirely sure that this is a regression; if it is, it's not a recent one (probably dating back to when ContentHandler was introduced, although I haven't tested back that far). But yes, this should be fixed.

Looking at the code, I don't see any sign of a regression here.

Change 83833 had a related patch set uploaded by Anomie:
API: Check for nosuchsection in all code paths

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

Change 83833 merged by jenkins-bot:
API: Check for nosuchsection in all code paths

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

Change merged. It should be deployed to WMF wikis with 1.22wmf19, see https://www.mediawiki.org/wiki/MediaWiki_1.22/Roadmap for the schedule.