New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with staff role #2
Comments
Hi Boxwell, thanks for the report. I've not previously been able to reproduce this locally, so I'll need some more details about your Moodle and course, such as URL, Moodle version, course format, and where possible copies of the error log entries relevant to that error (basically, as much detail as possible). I will attempt to force this error on my test server but a detailed error report from you would be considerably more useful. Regards, Vaughany. |
Apologies for lack of detail, I'm not used to working in a development environment! Our Moodle setup is as follows: I've turned developer level debugging on our Moodle setup and this is what I get when changing to staff role:
Anything else you might need then please let me know. Regards, Graeme |
It seems like MS SQL server was seeing a double-quoted number as a column name. I didn't know it did that, and I'll remember that for the future. I've committed a fix which you can see here: Either pull the change (if you cloned initially) or copy and paste the changed line into courseaward_vote/libvote.php using your favourite text editor. The link above shows the file and line you need to change quite clearly. I'll leave this issue open for a while so hopefully you will report back on success or failure. Vaughany. |
Hello, Yes, this has solved the problem. Thanks loads for your quick response and fix. Really appreciated. Best Regards, Graeme |
Excellent, glad to hear it. :) |
Hello again, We've recently installed your block in our production environment and it is working fantastically, with lots of students providing feedback on the Moodle courses. When I have come to pull off any of the highest score, most votes, etc reports we get an error reading database. With debugging turned on we get the following: Debug info: SQLState: 42000 SELECT course_id, shortname, fullname, ( SELECT COUNT(vote) SELECT COUNT(vote) SELECT COUNT(note) SELECT COUNT(note) SELECT medal SELECT AVG(vote) FROM mdl_block_courseaward_vote, mdl_course Invalid get_string() identifier: 'healthcenter' or component 'moodle'. Perhaps you are missing $string['healthcenter'] = ''; in lang/en/moodle.php?
Navigation node intersect: Adding a node that already exists qeupgradehelper
Have you any idea what we could do to rectify this? Thanks again for all your work on this. Graeme |
Hi Graeme. I'll take the easy problems first! Firstly, the error Invalid get_string() identifier: 'healthcenter' is a language string issue, and I don't think has anything to do with my module. If you have a module with this or a smiliar name installed, I'd investigate there first. It seems related to admin pages generally, not my module specifically. Secondly, Navigation node intersect: Adding a node that already exists qeupgradehelper is an error relating to the Question Engine Upgrade Helper, a new feature in Moodle 2.2 IIRC, and again nothing to do with my module, but probably related to admin pages generally. This may be fixed in a later version of Moodle. For the above two errors, I suggest you check your web server's error log as you're likely to see quite a lot more of them (assuming you have debugging turned on within Moodle). Finally, Incorrect syntax near 'LIMIT' is a problem of my own making. It turns out that MSSQL doesn't have the same LIMIT syntax as other database engines (I use and test on MySQL and have had users test on PostgreSQL for me). It is used to return 'x' rows of data from a database query which may return considerably more, and in this case appears to be returning the 'top 5' of something. I will look into this as soon as I can. For the time being, Can I suggest the following fix, which will remove the error but will show all results rather than the top 5 or so. in if ($limit > 0) {
$query .= " LIMIT ".$limit.";";
} else {
$query .= ";";
} ...and then add in this line: $query .= ";"; (If you're not aware, 'commenting out' means stopping the code from being executed without removing the code from the file. This is achieved by placing two forward slashes // if ($limit > 0) { I hope that's clear.) Repeat the process on lines starting 475 (which will actually be line 476 as you added a line in, above), and 848 (or 850). This will get you working for now and I will look into fixing the issue more permanently. Regards, and thanks for the report. Paul. |
Gah, I meant to also ask what versions of Moodle and MSSQL you are running. If you could let me know it would help immensely. P. |
Hi Paul, We are running: Hope this helps. Regards, Graeme Boxwell From: Paul Vaughan [mailto:notifications@github.com] Gah, I meant to also ask what versions of Moodle and MSSQL you are running. If you could let me know it would help immensely. P. — |
Hello,
I'm hoping you can help us.
We have installed the course awards block in Moodle 2.2. When we add it to a course site, it seems to be ok, until we change to a teacher role then we get an error message saying "Error reading from database".
It works fine as an admin and also as a student but our teacher role does not like it at all.
If you can think of anything we can do?
We have amended the code as discussed on moodle.org - The block's ability to be placed in certain areas is controlled on line 44 of block_courseaward_vote.php. Change:
return array('course-view' => true);
...to:
return array('all' => true);
and have made some amends to the language block to change the wording, but this is all.
Any help is greatly apprecaited.
Graeme
The text was updated successfully, but these errors were encountered: