How to to define "alias" report property ? (Subquery returns more than 1 row error) (file size and count report)

Re: How to to define "alias" report property ? (Subquery returns more than 1 row error) (file size and count report)

by Nadav Kavalerchik -
Number of replies: 2
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

An "alias" is used instead of the report's "id"

If you give a report id 5 the alias "coursefiles", then you can have another report call that report and pass it parameters and variables.

So, instead of previously calling a report by "viewreport.php?id=5&courseid=1", you can now call it by "viewreport.php?alias=coursefiles&courseid=1".

I developed this feature, so I can backup a bunch of reports on one Moodle server and restore it on several other Moodle servers and make sure the inter-report links do not break. (as any course restore on a different server with give it a different ID and it will break the inter-report linkage)

Hope it was more clear.

In reply to Nadav Kavalerchik

Re: How to to define "alias" report property ? (Subquery returns more than 1 row error) (file size and count report)

by Courtney Bentley -

Nadav, 

I think conceptually this makes great sense, but from a technical perspective where or how are you defining the alias? 

I also see on your devhub page where you developed a feature to hide sub-reports from the list. Could you share more details about how to engage that feature? 

In reply to Courtney Bentley

Re: How to to define "alias" report property ? (Subquery returns more than 1 row error) (file size and count report)

by Nadav Kavalerchik -
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

I have a forked version of CR block, but it very similar to the original. so here goes:

https://github.com/nadavkav/moodle-block_configurablereports/blob/M31/editreport_form.php#L49-L51

And this is where I use the ALIAS to get the $report

https://github.com/nadavkav/moodle-block_configurablereports/blob/M31/viewreport.php#L37-L39

Hope it make sense. would love any feedback smile