404 - File or directory not found.

404 - File or directory not found.

by anthony curtis -
Number of replies: 2

I have installed moodle core v2.1.3 and installed the Configurable Reports plugin.

I create a configurable report of type SQL query.

In the 'Custom SQL' Tab I enter the following very simple SQL:-

SELECT COUNT(l.id) hits, l.course courseId, c.fullname coursename FROM prefix_log l INNER JOIN prefix_course c ON l.course = c.id GROUP BY courseId ORDER BY hits DESC

I then click save changes and I get the error

404 - File or directory not found.

Can anyone tell me why and how to fix it?

Average of ratings: Useful (1)
In reply to anthony curtis

Re: 404 - File or directory not found.

by anthony curtis -

I have managed to resolve this issue.

The problem was that the sql was wrong!

I changed the sql to be the following :-

SELECT COUNT(l.id) hits, l.course, c.fullname 'Course name' FROM prefix_log l INNER JOIN prefix_course c ON l.course = c.id GROUP BY l.course, c.fullname ORDER BY hits DESC

I still dont know why the system gave me a 404 error.

I did find that by turning on debug and running the code on an IE browser at the web server, that I got some debug response that indicated a problem with the SQL, so that led me on the path of re-writing the query.

The original query was cut and pasted from the configurable reports examples link List of SQL Contributed reports and these examples may be pertinent only to MySql, whereas I am using MSSQL 2008. So that might explain the debug message about the wrong sql statement.

Average of ratings: Useful (1)
In reply to anthony curtis

Re: 404 - File or directory not found.

by Mark Thornton -

It would be a nice enhancement if the Configurable Reports block gave more inormation on the error.