Skip to content

Commit

Permalink
Added minor/notminor flags for action=edit
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyCat committed Aug 12, 2013
1 parent bf96154 commit e472acf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/media_wiki/gateway.rb
Expand Up @@ -132,9 +132,13 @@ def render(page_title, options = {})
# * [:overwrite] Allow overwriting existing pages
# * [:summary] Edit summary for history, string
# * [:token] Use this existing edit token instead requesting a new one (useful for bulk loads)
# * [:minor] Mark this edit as "minor" if true, mark this edit as "major" if false, leave major/minor status by default if not specified
# * [:notminor] Mark this edit as "major" if true
def create(title, content, options={})
form_data = {'action' => 'edit', 'title' => title, 'text' => content, 'summary' => (options[:summary] || ""), 'token' => get_token('edit', title)}
form_data['bot'] = '1' if @options[:bot]
form_data['minor'] = '1' if options[:minor]
form_data['notminor'] = '1' if options[:minor] == false or options[:notminor]
form_data['createonly'] = "" unless options[:overwrite]
form_data['section'] = options[:section].to_s if options[:section]
make_api_request(form_data)
Expand Down

1 comment on commit e472acf

@jpatokal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Code looks good, but please clarify the documentation of the minor/notminor flags to be in line with http://www.mediawiki.org/wiki/API:Edit#Parameters -- there's no such thing as a "major" edit, there's only a minor flag that can be true or false.

Also, can you please confirm that setting the bot assert flag does not cause problems on wikis that do not have AssertEdit installed?

Please sign in to comment.