مۆدیوول:Databox: جیاوازیی نێوان پێداچوونەوەکان
ناوەڕۆکی سڕاو ناوەڕۆکی زیادکراو
Aram (لێدوان | بەشدارییەکان) لابردنی ڕەنگە شینەکەی ناونیشانەکان (بەپێی ئێرە) |
Aram (لێدوان | بەشدارییەکان) Fixed Lua error in 'getBestStatementById' function by checking existence of datavalue field. The problem in the old version was that it didn't handle cases where the datavalue field was missing, causing a Lua error. The new version checks if datavalue exists before accessing its value field, preventing the error. Resolves issue with accessing qualifiers. (here) #Lua #Wikidata #BugFix #DataQualifiers |
||
ھێڵی ٢٥٨:
-- Returns the best statements for the first property this item has
function getBestStatementById(id, ...)
local statements = mw.wikibase.getBestStatements(
if
if mainsnak.snaktype == "value" and mainsnak.datavalue then
return mainsnak.datavalue.value
end
end
▲ return nil
end
|