| hoo closed this task as "Resolved". hoo added a comment. |
In T173194#3704857, @valerio.bozzolan wrote:I'm confused. Very confused.
From this diff I've added these lines to debug the value of item:
label = 'Normal: ' .. item sitelink = 'Absurd: ' .. itemYes, there are no other lines of code between these two lines.
Now:
=require('Module:Wikidata label/sandbox')._getLabel('Q123', 'en') -- Output: -- [[w:en:Absurd: Q123September|Normal: Q123]]That's normal. But running suddently then:
=require('Module:Wikidata label/sandbox')._getLabel('Q321', 'en') -- Output: -- [[w:en:Absurd: Q123September|Normal: Q321]]W-T-F - I'm - seeing.
Too Internet for today. Good night guys.
This actually took me a while to figure: The variable link in your function is not local, thus leaking state across function calls, that's why this behaves so weirdly. Declare it local and it should all be sane again.
TASK DETAIL
EMAIL PREFERENCES
To: Jarekt, hoo
Cc: valerio.bozzolan, Izno, daniel, Multichill, Aklapper, Ricordisamoa, JeanFred, Jarekt, ValterVB, Elitre, Jheald, Daniel_Mietchen, Nemo_bis, Aschroet, zhuyifei1999, Steinsplitter, Matanya, RP88, El_Grafo, Revent, Sjoerddebruin, Jane023, Susannaanas, Mike_Peel, Lydia_Pintscher, Micru, intracer, Poyekhali, Nizil, PokestarFan, hoo, E1presidente, Ramsey-WMF, Jmmuguerza, SandraF_WMF, GoranSMilovanovic, QZanden, Acer, Vali.matei, Volker_E, Wong128hk, Wikidata-bugs, PKM, Base, matthiasmullie, aude, GWicke, Fabrice_Florin, Raymond, Mbch331, Jay8g
Cc: valerio.bozzolan, Izno, daniel, Multichill, Aklapper, Ricordisamoa, JeanFred, Jarekt, ValterVB, Elitre, Jheald, Daniel_Mietchen, Nemo_bis, Aschroet, zhuyifei1999, Steinsplitter, Matanya, RP88, El_Grafo, Revent, Sjoerddebruin, Jane023, Susannaanas, Mike_Peel, Lydia_Pintscher, Micru, intracer, Poyekhali, Nizil, PokestarFan, hoo, E1presidente, Ramsey-WMF, Jmmuguerza, SandraF_WMF, GoranSMilovanovic, QZanden, Acer, Vali.matei, Volker_E, Wong128hk, Wikidata-bugs, PKM, Base, matthiasmullie, aude, GWicke, Fabrice_Florin, Raymond, Mbch331, Jay8g
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
