Extend mw.wikibase lua functions to allow accessing Structured Data on Commons (SDC) items (M-codes) in addition to Wikidata items (Q-codes). T223792 managed to extend mw.wikibase.getEntity function to work with SDC, but that is not true for other functions. For example mw.wikibase.getBestStatements does not work for SDC items (it might be related to the fact that SDC statements are stored in entity.statements structure while on Wikidata entity.claims is used). Other functions which do not seem to work on SDC:
- mw.wikibase.getEntity() - without the item ID, for accessing properties connected to the current page
- mw.wikibase.getEntityUrl() - without the item ID. getEntityUrl with id works fine.
- mw.wikibase.getEntityIdForCurrentPage
In general all mw.wikibase lua functions should be tested with SDC, even if some functions like mw.wikibase.getSitelink might make no sense on SDC. mw:Extension:Wikibase_Client/Lua should be updated with SDC info.