Topic on User talk:Dbastro

Jump to navigation Jump to search
Johnuniq (talkcontribs)

You have been editing Wikidata items relating to en:2018 Volta ao Algarve. If you view en:2018 Volta ao Algarve#List you will see that the following wikitext gives the error shown:

{{Cycling race/listofstages|Q47124292}}

Lua error in Module:Cycling_race at line 5955: bad argument #2 to 'sub' (number expected, got nil).

I am familiar with Lua modules and inspected line 5955 of en:Module:Cycling race but there are many inappropriate approaches in that module which make me not want to fix the problem. The issue is that the module is accessing Wikidata items related to the topic. One of them is supposed to contain a number, possibly with other text before or after, such a "abc 123 def". The module assumes the "123" will always be present. Something has changed at Wikidata recently to break that assumption. I'm hoping you will be able to work out what that is, and fix it. Thanks.

Dbastro (talkcontribs)

@Johnuniq, i did see this error in the cycling race module and will try to fix this. Hopefully in the pt module where I am more familiar with the system and then will see the other wikis. Best regards.

Johnuniq (talkcontribs)

I compared modules pt + fr + en + d. You copied fr to pt so they are the same, except that fr uses tab characters for indents but pt uses only spaces. They are very different from d + en. Why is that? Have, for example, en editors made changes that are required for the module to successfully work at en? Or are people just making random tweaks to the module without realizing that they should be updating the master at d?

By the way, if you want to stop the error we discussed above, at pt make the following change.

-- Line 5580
tonumber(sNumber), sLetter,  -- Sort keys

-- should be
tonumber(sNumber) or 0, sLetter,  -- Sort keys

Sorry to ask so many questions, but I am also wondering whether you are aware that most string.find functions in the module should be string.match? I would fix it up but which version should I edit!?

Reply to "2018 Volta ao Algarve"