Page MenuHomePhabricator

action=edit&section=new&appendtext=... duplicates lead content
Closed, ResolvedPublic

Description

Using api.php?action=edit&title=Talk:Sandbox&section=new&sectiontitle=bar&appendtext=baz&token=(token), where Talk:Sandbox contains the content "foo", results in the content "foo\n==bar==\nfoobaz". The lead content is duplicated in the new section, before the appendtext content.


Version: 1.22.0
Severity: normal

Details

Reference
bz52538

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 1:52 AM
bzimport added a project: MediaWiki-API.
bzimport set Reference to bz52538.
Yair_rand created this task.Aug 5 2013, 1:23 AM
Anomie added a comment.Aug 5 2013, 3:31 PM

I'm not entirely sure whether specifying appendtext/prependtext with section=new should be an error or if we should DWIM and append/prepend to an empty section.

I'll go with the latter for now, but I could easily be convinced to do the former.

Change 77716 had a related patch set uploaded by Anomie:
API: DWIM for action=edit&section=new&appendtext=...

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

Change 77716 merged by jenkins-bot:
API: DWIM for action=edit&section=new&appendtext=...

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

Anomie added a comment.Aug 6 2013, 1:56 PM

The patch is now merged. It should be deployed to WMF wikis with 1.22wmf13, see https://www.mediawiki.org/wiki/MediaWiki_1.22/Roadmap for the schedule.