Thread:Extension talk:Scribunto/Check whether title exists, otherwise load data/reply


 * Hello:
 * I have not used any of the title objects yet, as I don't have the latest Mediawiki nor the latest Scribunto extension installed; however, I noted that one of the title objects is fileExists: and is expensive. - This might answer the question concerning whether "File:Flag_of_Andorra.svg" exists or not.
 * You could set up some local variable to indicate when you run a particular mv.loadData for a table. ie. "local flags_data_loaded = 0" and when table is loaded change "flags_data_loaded = 1". (that might help?)
 * Note: It is also possible to test whether mv.loadData is successful or not without the resulting Script Error "Module not found" message. One can then work with the conditions (mistyped module name/missing module): if an mv.loadData is successful do one thing and if it fails do something else. (I will be testing a module on en.wikipedia to demonstrate how that is done -- can post link when done if anyone wants to look at it) ...
 * I am sure others will jump in and provide better answers than I can ! Best wishes on your project! Cheers!