All,
There was recently a major upgrade to Moodle Docs Mediawiki to version 1.3. This includes some major changes to the wiki syntax, which affected all the code on the Ad-hoc reports page.
I have taken it upon myself to fix all those and the page is now working again. There is a new syntax style for code and I think, at least, it looks a lot more readable than the old mediawiki style. The old syntax using "code" is gone and replaced by a new style using "syntaxhighlight" (see more on this at the Mediawiki page about it.)
Please let me know if there is any code there that remains broken. Feel free to fix it yourself of course ;)
Also, I have take this opportunity to add some new content to the page: I have added an introduction for new users which contains some basic information on the plugins, how some of the quirks of the queries on the page work (eg, what prefix_ means, dates and formatting, etc.) I have also added some pages at the end with some useful things like common constants, table aliases, variables, code snippets, etc.
I have added a section called "Suggestions for contributors." I hope people will agree me with me that these are useful suggestions. Most of these suggestions come from what I see in this forum over the years, where people trying to use the queries have issues with them arising from queries written for old versions of Moodle, or another dialect of SQL, and so forth.
Further cleaning up?
In particular, there are lots of old queries from Moodle 2.x days and even a few antiques from Moodle 1.9 days. These only cause frustration for new users of Moodle trying to use them. I think it is a reasonable expectation that on a page for Moodle 3.11, for example, that the queries there should work on Moodle 3.11.
So, I would like to float the idea of whether it would be a good thing to remove old queries from this page. I'm not sure though if that is a good idea or exactly what "old queries" would mean. In many cases, it would be very hard to figure out who wrote a query and even then they may be long gone from the community and have no interest in reviewing old queries. Still, I think it would be useful to help reduce the issues for people use the page.
Thoughts on this?