Page MenuHomePhabricator

ApiFlowUndoEditTopicSummary uses incorrect module name
Closed, ResolvedPublic


The paraminfo for flow+undo-edit-topic-summary uses the same name as that for flow+edit-topic-summary but with different content:

The paraminfo for [[|action=paraminfo&modules=flow]] lists both modules and [[|action=paraminfo&modules=flow+edit-topic-summary]] also shows the data for flow+edit-topic-summary but [[|action=paraminfo&modules=flow+undo-edit-topic-summary]] uses actually flow+edit-topic-summary as path and edit-topic-summary as name. I'm not sure if StructuredDiscussions is simply configured wrongly but I'd prefer if the API itself recognizes that the name/path is inconsistent (which is why I added it).

For Pywikibot this will be hard to recover from. I guess if it doesn't get modules which it requested, it will discard the data (at least the ambiguous) and request each separately to make sure it can assign names.

Event Timeline

XZise raised the priority of this task from to Needs Triage.
XZise updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Anomie renamed this task from Inconsistent paraminfo for flow+undo-edit-topic-summary to ApiFlowUndoEditTopicSummary uses incorrect module name.Jul 10 2015, 12:53 PM
Anomie moved this task from Unsorted to Non-core-API stuff on the MediaWiki-API board.
Anomie set Security to None.

The simple fix would be to fix ApiFlowUndoEditTopicSummary::__construct() to pass the correct name to the parent class.

A more robust fix would be to actually use the $name parameter being passed in from ApiModuleManager, in ApiFlowUndoEditTopicSummary and any other classes that are doing the same sort of thing.

Yes a more solid for any module which might have typos would be appreciated. Sure it's possible to fix that specific solution but I dread the next situation where this happens. And I'm not sure if it's possible to have some unit tests for extensions which do some sanity checks like that.

Change 224066 had a related patch set uploaded (by Matthias Mullie):
Use correct module name for ApiFlowUndoEditTopicSummary

Change 224066 merged by jenkins-bot:
Use correct module name for ApiFlowUndoEditTopicSummary

Checked in beta.
e.g. Request URL:


for edit-topic-summary:

Request URL:


DannyH added a subscriber: DannyH.

Granted I don't really know how the API internally works and the original issue has been fixed, I'd appreciate if this can't happen anymore. For example the name/path returned in ParamInfo are always the module's name. Somewhere the module has been added as undo-edit-topic-summary and that should be returned there and I don't see any reason why a module should be able to change that afterwards.