OU Blog - separate individual blogs - error reading database

OU Blog - separate individual blogs - error reading database

by Huw Smith -
Number of replies: 3

When a OU Blog is set to use Separate individual blogs and a student or lecturer clicks on the blog they get error reading database.

With debugging turned on this message is displayed:

Debug info: Unknown column 'U.id' in 'where clause'

SELECT COUNT(1) FROM (SELECT p.id, p.title, p.timeposted, p.groupid, 

p.allowcomments, p.visibility,

bi.userid, bi.name AS blogname, u.id AS posteridx,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email

FROM mdl_oublog_posts p

INNER JOIN mdl_oublog_instances bi ON p.oubloginstancesid = bi.id

INNER JOIN mdl_user u ON bi.userid = u.id 

WHERE p.deletedby IS NULL AND oublogid = ?

AND p.timedeleted IS NULL AND U.id = ? 

ORDER BY p.timeposted DESC ) as p

[array (

0 => '65',

1 => 11129,

)]

Error code: dmlreadexception


Stack trace:

line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown

line 1062 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

line 1428 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()

line 1501 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()

line 4408 of /mod/oublog/locallib.php: call to moodle_database->get_field_sql()

line 4098 of /mod/oublog/locallib.php: call to oublog_get_participation_details()

line 319 of /mod/oublog/view.php: call to oublog_stats_output_participation()


This happens to existing blogs and newly created blogs.

We are using Moodle 2.6.8 and oublog version 2014072501

This is happening on 2 different Moodles, both on 2.6.8. both were recently upgraded from Moodle 2.6.6 and oublog 2014042500


Any suggestions how to fix this?

Average of ratings: -
In reply to Huw Smith

Re: OU Blog - separate individual blogs - error reading database

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 looks like it is just a typo. Should be u.id, not U.id. I will make sure Jason sees this.

In reply to Huw Smith

Re: OU Blog - separate individual blogs - error reading database

by Jason Platts -

This bug was fixed in the 2.7 version, however as we don't support older versions, such as the 2.6 one, you will need to manually update the file in your code base/on server. See the change here: https://github.com/moodleou/moodle-mod_oublog/commit/1d5a7ca99b027fd400c4e33ddb6c5ad2541e2fe9

 

Thanks for using... (Oh and it's best to flag any errors in oublog via the github issue tracker, you can also search for open/closed issues there)

In reply to Jason Platts

Re: OU Blog - separate individual blogs - error reading database

by Huw Smith -

Thanks, that fixed the problem.