Last modified: 2014-02-12 23:48:08 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 T51277, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49277 - wgIsPageEditable is a lie
wgIsPageEditable is a lie
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
beta (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Jon
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-06 22:07 UTC by Jon
Modified: 2014-02-12 23:48 UTC (History)
10 users (show)

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


Attachments

Description Jon 2013-06-06 22:07:25 UTC
It seems sometimes mw.config.get( 'wgIsPageEditable' ) is set to true on pages that cannot be edited.

For example on wikipedia desktop main page I see a view source button but on https://en.m.wikipedia.org/wiki/Main_Page I see an edit button.
Comment 1 Matthew Flaschen 2013-06-06 22:42:50 UTC
It's just:

$vars['wgIsPageEditable'] = $user->isAllowed( 'edit' ) && $title->getNamespace() == NS_MAIN

It doesn't take protection into account at all, let alone other things (like cascading protection).  At the very least, it should use quickUserCan.  See bug 43790 and https://gerrit.wikimedia.org/r/#/c/65009/ for discussion of adding a proper version of this to core.

It also excludes non-mainspace, but I assume that's intentional (really not "is it editable?", though, but "is mobile ready to edit it?").
Comment 2 Jon 2013-06-12 21:41:56 UTC
Correct. It currently means can mobile edit but yeh looks like quickCanUserEdit is the way to go! Thanks :)
Comment 3 Gerrit Notification Bot 2013-06-13 19:05:47 UTC
Related URL: https://gerrit.wikimedia.org/r/68483 (Gerrit Change Ic924e810b34276312790a41b5455909737cc2082)
Comment 4 Gerrit Notification Bot 2013-06-13 23:44:02 UTC
https://gerrit.wikimedia.org/r/68483 (Gerrit Change Ic924e810b34276312790a41b5455909737cc2082) | change APPROVED and MERGED [by jenkins-bot]

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


Navigation
Links