Page MenuHomePhabricator

[Task] Remove wbUserCanEdit and wbUserIsBlocked config variables
Closed, ResolvedPublic

Description

Setting wbUserIsBlocked involves a database request, which seems like not a good thing.

wbUserCanEdit and wbUserIsBlocked are used in wikibase.ui.entityViewInit.js to double check if a user can edit, and if so, initializes relevant javascript.

core doesn't do this for wikitext pages and really don't think wikibase needs to do this. We now rely on core's mechanism (for the most part) for whether or not edit links are displayed.

Details

Related Gerrit Patches:

Event Timeline

aude created this task.Mar 24 2015, 5:24 PM
aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude added a subscriber: aude.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 24 2015, 5:24 PM

I agree. It would be great if the toolbar controller would just initialize on top of existing toolbars and not add missing ones on the fly. We would need to add empty toolbars for statements to the static HTML. Then, this could actually work.

Adrian_WMDE: aude: We could also replace the config var with a $( '.wikibase-toolbar' ).length > 0 check
Adrian_WMDE: That would be pretty crude, but work

Adding @Ricordisamoa to see if they see any issue with this from the gadget author side.

Lydia_Pintscher triaged this task as Normal priority.Mar 25 2015, 9:48 AM

I can't find any occurrences of either of the two variables in scripts/gadgets (they could use wgRestrictionEdit, wgIsProbablyEditable or Adrian's hack anyway), so no problem from our side.

aude renamed this task from Remove wbUserCanEdit and wbUserIsBlocked config variables to [Task] Remove wbUserCanEdit and wbUserIsBlocked config variables.Aug 13 2015, 9:13 PM
aude set Security to None.
Lydia_Pintscher lowered the priority of this task from Normal to Low.Apr 23 2017, 5:00 PM
Lydia_Pintscher added a project: patch-welcome.
Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptJun 6 2017, 2:07 AM

Adding performance as this happen in every page view (unless being loaded from varnish) I think this should have higher priority.

Change 357334 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase@master] Drop wbUserCanEdit and wbUserIsBlocked config variables

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

These config variables are not used in wikidata.org (at least per my search of wbUserIsBlocked and wbUserIsBlocked)

Jonas closed this task as Resolved.Jun 7 2017, 8:44 AM
Jonas moved this task from Review to Done on the Wikidata-Former-Sprint-Board board.

Change 357334 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Drop wbUserCanEdit and wbUserIsBlocked config variables

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

Change 358346 had a related patch set uploaded (by Thiemo Mättig (WMDE); owner: Thiemo Mättig (WMDE)):
[mediawiki/extensions/Wikibase@master] Add test for the core dependency on wgRelevantPageIsProbablyEditable

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

Change 358346 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Add test for the core dependency on wgRelevantPageIsProbablyEditable

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