Module:MwJson: Difference between revisions

fix: label of subobjects without eval_template
(Update package: OSW Core)
(fix: label of subobjects without eval_template)
Line 1,051: Line 1,051:
else display_label = properties["HasName"] end
else display_label = properties["HasName"] end
-- fall back to unmapped keywords
-- fall back to unmapped keywords
elseif (jsondata[p.keys.label] ~= nil and jsondata[p.keys.label][1] ~= nil) then display_label = p.splitString(jsondata[p.keys.label][1], '@')[1]  
elseif (jsondata[p.keys.label] ~= nil and jsondata[p.keys.label][1] ~= nil) then
if type(jsondata[p.keys.label][1]) ~= 'table' then display_label = p.splitString(jsondata[p.keys.label][1], '@')[1]
else display_label = jsondata[p.keys.label][1][p.keys.text] end -- no eval_template applied
elseif (jsondata[p.keys.name] ~= nil) then display_label = jsondata[p.keys.name]  
elseif (jsondata[p.keys.name] ~= nil) then display_label = jsondata[p.keys.name]  
end
end
 
mw.log("LABEL")
mw.logObject(jsondata[p.keys.label])
return display_label
return display_label
end
end