Ad-hoc Database Queries Error?

Ad-hoc Database Queries Error?

by Rachel Grzymkowski -
Number of replies: 8

Hello on Moodle 3.5 and just downloaded the Ad-hoc Queries reporting

New Moodle user here


Is there any documentation on Ad-hoc Database Queries that would help set up exporting to csv report to path / directory? I receive an "does not exist" error every time i type in a shared drive or local drive from my computer. I'm sure it's because Moodle isn't mapped to our drives but i'm not sure how to proceed. 


Error pictured below.


Thank you 



Attachment Error.jpg
Average of ratings: -
In reply to Rachel Grzymkowski

Re: Ad-hoc Database Queries Error?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This report is not capable of saving to a shared 'folder'. To you, an shared folder might look like any other folder, but to PHP code, the two things are very different.

This report can only save to a 'real' folder in the server's file system.

So, your options are:

  • Set up a folder on the server which can be accessed as a share, and write the files there.
  • Use some other way of mounting the place where you want the reports saved into the server's file system.
  • Instead rely on emails to get the reports to you.
  • Improve the code of this reprot, so it can be more flexible about where it saves files.
Sorry, none of those are particuarly great.


Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Ad-hoc Database Queries Error?

by Rachel Grzymkowski -

Tim


Thanks for the quick reply. I decided to go with emailing the reports, at least for right now but i'm receiving a similar error stating "the user with the set username does not exist" but that's not true. I've tried several different users within Moodle including myself and none seem to work. Am I entering the information wrong? 

In reply to Rachel Grzymkowski

Re: Ad-hoc Database Queries Error?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You need to enter the user's username (that they use to log in). I don't know why it was implemented that way. These days there are better widgets in Moodle for selecting a particular user. i guess we coded this before those existed.

(Code is here https://github.com/moodleou/moodle-report_customsql/blob/master/locallib.php#L538. I cannot see anything obviously wrong with it.)

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Ad-hoc Database Queries Error?

by Rachel Grzymkowski -

Tim

Another question. If we were looking to improve the code of the report to be more flexible. Where would we go to access the code to improve?

In reply to Tim Hunt

Re: Ad-hoc Database Queries Error?

by Tifano T -

Hi Tim et al,

I have used option number 1.

Set my schedule to run at 00:00 and server drectorry path to dump file as follows:

/home/username/moodledata/reports


However,nothing's getting dumped.


What am  doing wong here?


Thanks in advance for your help.


Cheers

In reply to Tifano T

Re: Ad-hoc Database Queries Error?

by Tifano T -

Never mind, it all works fine now, was  just not patient enough lol smile