MediaWiki-diskusjon:Gadget-WikidataInfo.js
Feilmelding[rediger kilde]
Denne funksjonen gir feilmelding — Jeblad 24. feb. 2016 kl. 09:05 (CET)
TypeError: item.descriptions[lang] is undefined https://no.wikipedia.org/w/load.php?debug=true&lang=nb&modules=ext.gadget.WikidataInfo&only=scripts&skin=vector&version=b49f93ef96bc Line 386
Feilmeldingen har opphav i manglende tester. Forslag til løsning nedenfor. — Jeblad 24. feb. 2016 kl. 11:20 (CET)
Endre linje 378
.text(m.intro + ( item.labels ? item.labels[lang].value : m.nolabel ) ),
til
.text(m.intro + ( (item.labels && item.labels[lang]) ? item.labels[lang].value : m.nolabel ) ),
Endre linje 386
.text( item.descriptions ? item.descriptions[lang].value : m.nodescription )
til
.text( (item.descriptions && item.descriptions[lang]) ? item.descriptions[lang].value : m.nodescription )