Last modified: 2014-06-24 03:46:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60789, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58789 - page.Save() does not support sysop parameter
page.Save() does not support sysop parameter
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Pywikipedia bugs
:
Depends on:
Blocks: 55880
  Show dependency treegraph
 
Reported: 2013-12-21 11:37 UTC by Merlijn van Deen (test)
Modified: 2014-06-24 03:46 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Merlijn van Deen (test) 2013-12-21 11:37:49 UTC
In compat, page.Save can be passed sysop=True to force a sysop edit; in core, the edit just errors out:

"pywikibot.exceptions.PageNotSaved: [[MediaWiki:Gadget-false-blue-links.js]]: protectednamespace-interface: You're not allowed to
                 edit interface messages"
Comment 1 Sorawee Porncharoenwase 2014-02-06 18:46:37 UTC
It doesn't work because of "@must_be(group='user')" on top of Site.editpage(). Should I create a new function like Site.editpage_sysop()? Or should I remove "@must_be(group='user')"?
Comment 2 Sorawee Porncharoenwase 2014-02-06 18:56:25 UTC
By the way, here is my workaround. It's ugly, though

# In APISite
def performAsSysop(self, user)
    self.logout()
    self._username[False] = user
    self.login(False)
Comment 3 Merlijn van Deen (test) 2014-02-06 19:38:47 UTC
I think we should adapt the must_be decorator to take a new runtime parameter (e.g. as_group), which would override the group defined by the original function.

(this would adapt kwargs inside must_be.decorator.callee)
Comment 4 Sorawee Porncharoenwase 2014-02-06 22:06:38 UTC
I think that new parameter would not be necessary. If we call some functions whose group='user' and there is the parameter sysop=True, obviously we want to call that function as sysop but in user manner (like editing).
Comment 5 Gerrit Notification Bot 2014-02-07 00:38:39 UTC
Change 111943 had a related patch set uploaded by Nullzero:
Support editing as a sysop

https://gerrit.wikimedia.org/r/111943
Comment 6 Gerrit Notification Bot 2014-02-08 20:21:46 UTC
Change 111943 merged by jenkins-bot:
Support editing as a sysop

https://gerrit.wikimedia.org/r/111943
Comment 7 Sorawee Porncharoenwase 2014-02-08 21:13:20 UTC
How to change the status to RESOLVED FIXED?
Comment 8 Merlijn van Deen (test) 2014-02-08 21:19:32 UTC
There should be a selection box below the comment box ('Status: [PATCH_TO_REVIEW v]'). If not, ask Andre (aklapper@wikimedia.org) for 'editbugs' rights.

However, I'm keeping this open, as def save should either get a working 'sysop=...' parameter or a @deprecated('sysop', 'as_group="sysop"') decorator.
Comment 9 Gerrit Notification Bot 2014-02-08 22:03:56 UTC
Change 112299 had a related patch set uploaded by Nullzero:
Switch sysop parameter to as_group='sysop'

https://gerrit.wikimedia.org/r/112299
Comment 10 Gerrit Notification Bot 2014-06-24 01:37:12 UTC
Change 112299 merged by jenkins-bot:
Mark sysop parameter as deprecated

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links