Page MenuHomePhabricator

Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled and local, or only accept loaded local entities (or at least, not crash)
Open, Needs TriagePublic

Description

Shouldn't be listed:

  • Special:AvailableBadges
  • Special:NewItem
  • Special:EntitiesWithoutDescription
  • Special:EntitiesWithoutLabel
  • Special:GoToLinkedPage
  • Special:ItemByTitle
  • Special:ItemDisambiguation
  • Special:ItemsWithoutSitelinks
  • Special:MergeItems
  • Special:RedirectEntity
  • Special:SetDescription
  • Special:SetLabel
  • Special:SetSiteLink
  • Special:SetAliases
  • Special:SetLabelDescriptionAliases

Or able to load:

  • Special:AvailableBadges
  • Special:NewItem
  • Special:EntitiesWithoutDescription
  • Special:EntitiesWithoutLabel
  • Special:GoToLinkedPage
  • Special:ItemByTitle
  • Special:ItemDisambiguation
  • Special:ItemsWithoutSitelinks
  • Special:MergeItems
  • Special:NewProperty
  • Special:RedirectEntity
  • Special:SetDescription
  • Special:SetLabel
  • Special:SetSiteLink
  • Special:SetAliases
  • Special:SetLabelDescriptionAliases

Are fine:

  • Special:DispatchStats
  • Special:ListProperties
  • Special:EntityData
  • Special:EntityPage
  • Special:MyLanguageFallbackChain

Maybe should change:

  • Special:ListDatatypes - should be blank or in some other way show that the data types are known but not allowed?

API modules:

  • wbeditentity - Should not allow input of IDs for non local entities
  • TBA more modules...

Related Objects

Event Timeline

Excerpt:

11:25:35 <addshore> right, there are some things we probably didnt think about
11:26:46 <addshore> special pages and api modules should be registered conditionally based on the entity types loaded
11:26:47 <addshore> for example
11:26:59 <addshore> we don't want Special:NewItem for example on commons
11:27:03 <addshore> and right now we have it
11:27:15 <James_F> Easy to fix, or will we need to re-arch. half of Wikibase?
11:27:22 <addshore> api modules are trickeier, as I guess we want wbeditentity, but probably with different examples
11:27:37 <addshore> should be an "easy fix" will spend some time about how to do it right
11:27:52 <addshore> whats the planned date for getting this on real commons?
11:27:59 <addshore> i'll keep looking around for other things
11:32:40 <addshore> https://usercontent.irccloud-cdn.com/file/ofmgiw50/image.png
11:32:51 <addshore> I feel like this should be a different error message, mildly concerning
11:33:31 <James_F> It should fail earlier.
11:34:01 <addshore> yup
11:34:49 <addshore> looking at the code it special new item already shouldnt load
11:34:50 <addshore> hmm
11:35:08 <addshore> hmmhmmmmhmm
11:36:47 <addshore> https://www.irccloud.com/pastebin/kvEIZe6O/
11:36:59 <addshore> that is in Wikibase.php in mw-config and loaded for all wikibases
11:37:55 <addshore> right, I dont like this config now
11:38:07 <addshore> Wikibase.php is conditionality loaded based on if ( $wmgUseWikibaseRepo || $wmgUseWikibaseClient ) {
11:38:22 <addshore> for commons wiki that means Wikibase.php it loaded because $wmgUseWikibaseClient is true
11:39:14 <addshore> so we should either add $wmgUseWikibaseMediaInfo to the CommonsSettings.php condition
11:39:18 <addshore> or think about something else to do
11:39:44 <addshore> Right, wikibase.php also needs more cleanup
11:39:45 <addshore> meh
11:39:54 <addshore> i dont think we want to put mediainfo on beta today
11:40:07 <addshore> I can try and look at cleaning this up at some point, but not today i doubt it
11:40:39 <addshore> James_F: we should probably turn wikibase repo off on beta, it will currently allow you to create properties etc, and we don't want that and id rather not have to clean stuff up
11:41:06 <James_F> OK.
11:41:14 <addshore> ty :)
11:41:43 <addshore> but im glad we did this as early as possible, :) makes it easier than spending a week just thinking about the things that need to happen etc.
11:42:41 <James_F> Yeah.

It actually looks like pages like Special:NewItem already have a check that means they shouldn't be listed when the relevant entity type is not defined, but there was an issue with the confg that we tried on beta earlier that meant these entity types were enabled.
The entity type will actually be defined when comons "federates" its items to wikidata.org, so we should make sure this check still does the correct thing..

Jdforrester-WMF renamed this task from Wikibase Repo api modules and special pages should be conditionality loaded based on entity types enabled? to Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled?.Oct 24 2018, 12:38 AM

Also CreateProperty should probably be de-listed whilst it's inoperable.

Jdforrester-WMF renamed this task from Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled? to Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled (or at least, not crash).Jan 11 2019, 12:02 AM

It actually looks like pages like Special:NewItem already have a check that means they shouldn't be listed when the relevant entity type is not defined, but there was an issue with the confg that we tried on beta earlier that meant these entity types were enabled.
The entity type will actually be defined when comons "federates" its items to wikidata.org, so we should make sure this check still does the correct thing..

Just to clarify: currently, all of these are actually available and listed on production Commons. The ones that edit seem to get an error on submit (e. g. “Entities of type: item is not provided by source: local”), behavior for the others seems to vary.

Would it help to remove the relevant rights from users on commons? If users don't have property-create, it'll cleanly block them from trying to create new properties. Other wikibase rights that are given to * include property-term, item-term, mediainfo-term (which should probably be kept), and item-redirect.

Yup, it would also make sense to conditionally load those.

Addshore renamed this task from Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled (or at least, not crash) to Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled and local (or at least, not crash).Apr 12 2021, 8:39 AM
Addshore renamed this task from Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled and local (or at least, not crash) to Wikibase Repo api modules and special pages should be conditionally loaded based on entity types enabled and local, or only accept loaded local entities (or at least, not crash).
Addshore updated the task description. (Show Details)

Possibly useful information for people tackling this: WikibaseLexeme already registers API modules and special pages conditionally, see Registrar.php and T195615.

Also, at least Special:SetLabel is actually functional on Commons (it edits the caption of MediaInfo entities).