offspot / wikifundi

Create a pre-configured Mediawiki for offline Wikipedia contribution teaching
11 stars 2 forks source link

Create a mock extension of Wikibase #103

Open rgaudin opened 2 years ago

rgaudin commented 2 years ago

Most of the visual issues we get when mirroring for WikiFundi are Lua Errors raised by a failing call to Wikidata via the Wikibase extension.

Wikibase client extension offers an API to retrieve data from a live WIkidata instance. This can't work offline of course so we can't configure it and thus the API is not present.

This Lua API (mw.wikibase) is uses in a lot of pages (via {#invoke} calls, templates, and modules).

While it's possible for an API user to check whether Wikidata is supported (mw.wikibase != nil), close to no one takes care of this.

We are currently dealing with this by removing parts of pages, or clearing templates that use it. Frequently, that means getting rid of a page's infobox altogether because somewhere down the template dependency graph, there is such a call.

One alternative that could work (needs testing) would be to create an extension providing the mw.wikibase API, returning fake-yet non-breaking data on all methods.

Cacucho commented 2 years ago

Thanks for the explanation around issue #118! I was aware by Anthere that all references to Wikidata should be cleared before importing. But it couldn't be possible because those articles were imported directly from Wikipedia. Good luck with the mock extension!