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.

Event Timeline

aude raised the priority of this task from to Needs Triage.
aude updated the task description. (Show Details)
aude subscribed.

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.

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 Medium to Low.Apr 23 2017, 5:00 PM
Lydia_Pintscher added a project: patch-welcome.

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 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