Thread:Extension talk:Scribunto/Difficulties in getting this extension to work/reply (4)

Okay, problem solved, but in the spirit of Good Guy Greg (even though the analogy isn't totally apt because someone did reply), I'll post how it was solved: Lesson learned: Be careful about importing pages from wikis that might have pre-Scribunto or otherwise incompatible templates you are importing along with them (if you have the "Include templates" box checked when you export). If you do import those templates, and can't figure out which one it was, then mass deletion and re-importation of templates might be the only option. If an imported bad revision is of a more recent date/time than the Wikipedia templates you try to import on top of them, the Wikipedia revisions will be buried in the revision history and the bad revisions will continue to cause problems. Basically, if you're importing pages from wikis other than Wikipedia, watch out for that "Include templates" option; you could be causing some major problems.
 * 1) I had a wiki that lacked Scribunto, so when I imported some newer templates from Wikipedia, they didn't work (the #invoke statements were not supported).
 * So, I installed Scribunto, but then it still didn't work for some reason; I was getting Script errors, which if memory serves I was eventually able to get rid of by installing the development version of Scribunto, upgrading to the development version of MW (1.22alpha), making sure I imported every single template I needed, etc. So at this point, everything was finally working. Life was good for awhile; all templates were functional.
 * 1) Next, I imported some pages from other wikis, which also has some pre-Scribunto templates on them. I had the "Include templates" box checked on Special:Export. At some point in this process, Scribunto quit working completely and starting giving script errors on all templates. See this link if you want to see the screenshot; it says 1. (tail call): ? 2. mw.site.lua:32: ? 3. (tail call): ? 4. [C]: in function "xpcall" 5. MWServer.lua:73: in function "handleCall" 6. MWServer.lua:266: function "dispatch" 7. MWServer.lua:33: in function "execute" 8. mw_main.lua:7: in main chunk 9. [C]: ?
 * 2) I upgraded to the latest development version of Scribunto and it was still giving those errors.
 * 3) I deleted everything in the Module and MediaWiki namespaces and re-imported and it was still giving those errors.
 * 4) I deleted Template:Infobox criminal and its dependencies from my wiki and re-imported from Wikipedia with all dependencies and it was still giving those errors. I'm not sure why this didn't work.
 * 5) I disabled all extensions except Scribunto and it was still giving me those errors.
 * 6) For testing purposes, I created a new wiki with the latest MW development version (1.23alpha), and did a require_once in LocalSettings.php to the same Scribunto files my other, older MediaWiki installation was using. Then I imported to that test wiki Template:Infobox criminal and its dependencies from Wikipedia. The template worked!
 * 7) I upgraded the old wiki to the latest MW development version (1.23alpha) and I was still getting a script error. When I clicked on it, it was the exact same description as before.
 * 8) On the old wiki, I created a new namespace, Backup: I then installed Extension:OneColumnAllPages, ran Special:OneColumnAllPages, copied and pasted a list of all the template page titles into a file along with pipes and new page titles with Backup: prefixes, and then used moveBatch.php to move all the templates over to the Backup: namespace. So now, the Template: namespace was empty.
 * 9) Then I re-imported the necessary templates from Wikipedia. Everything was now working.