Open desb42 opened 5 years ago
Will be working on this next. It looks like formatValues
is like formatValue
but for lists. Relevant links below
formatValues
: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/client/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibrary.phprenderSnaks
: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/68b16d27282821055680ada0255dcaeaca530e0b/client/includes/DataAccess/Scribunto/SnakSerializationRenderer.phprenderSnaks
: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/6fd5120c0d6671722dc88fbe11f6b1d102273499/client/tests/phpunit/includes/DataAccess/Scribunto/LuaWikibaseLibraryTests.luaSo, this looks pretty complicated as Wikibase has multiple formatters for each of the property types.
For now, I added a naive implementation which redirects formatValue and formatValues to renderSnak and renderSnaks. This removed the errors above, but will likely have other effects
I'm also going to move this back to to-do and tackle other issues next. Unfortunately, I have visitors from out of town this entire week, so probably won't be posting until November.
Another example, this time using formatValue
page he.wikipedia.org/wiki/The_Division_Bell
in the 'external links'
(I am using Google translate - my Hebrew is non existant)
This calls he.wikipedia.org/wiki/תבנית:קישורי_אלבומים
(Template: Album links)
which calls he.wikipedia.org/wiki/יחידה:מזהים_חיצוניים
(Module: External identifiers)
most of the 'album links' are of the form Property - Name = LinkTemplate
The exception is P1729-AllMusic=
- no LinkTemplate
However, 'Module: External identifiers' can handle that, it uses formatValue in the line:
link = string.match(mw.wikibase.formatValue(properyVal[1].mainsnak), '%[([^ ]+)')
This does some magic that I cannot determine - but the result for this page is
link = https://www.allmusic.com/album/mw0000113053
Another way to 'temporarily' fix this is to change 'Template: Album links' change the line
|P1729-AllMusic=
to
|P1729-AllMusic=https://www.allmusic.com/album/$1
the page
he.wikipedia.org/wiki/יובל_נאמן
contains two instances of the above error (This is one of many hewiki pages exhibiting this problem)On investigation, it seems that Module:PropertyLink is calling
mw.wikibase.formatValues
(potentially in many places)Reviewing the xowa sources I can only find a definition for
formatValue
(singular) [although there is some commented out code with some php referring to formatValues]I pluralised all formatValue to formatValues and am now getting
Err: method not implemented
which is kind of what is expectedNext is to understand what 'rich-wikitext' is all about