Hi, thanks in advance for your help...
We were running Moodle 2.5.x and recently upgraded to 2.7.x. For some reasons, some of our old database queries stopped working. These queries were working perfectly in 2.5.x before, using ad-hoc database query 3rd party plugin:
SELECT lo.course AS Course_ID, co.shortname AS Course_ShortName, co.fullname AS Course_FullName,r.name, COUNT(r.name) as Forum_Posts
FROM prefix_log lo
INNER JOIN prefix_course co ON (co.id = lo.course)
INNER JOIN prefix_user us ON (lo.userid = us.id)
INNER JOIN prefix_role_assignments ra ON (ra.userid = us.id)
INNER JOIN prefix_context ctxt ON (ctxt.id = ra.contextid AND
ctxt.instanceid = co.id AND ctxt.contextlevel = 50)
INNER JOIN prefix_role r ON (r.id = ra.roleid)
WHERE lo.action LIKE '%add%' AND (lo.url LIKE '%discuss%' OR lo.url LIKE '%view%') AND FROM_UNIXTIME(lo.time) > '2015-05-03' AND FROM_UNIXTIME(lo.time) < '2015-05-09' AND (co.shortname LIKE '%15/UA%' OR co.shortname LIKE '%15/UB%' OR co.shortname LIKE '%15/SL%' ) AND lo.course <> 1 AND lo.module = 'forum'
GROUP BY Course_ID, r.name
ORDER BY co.fullname
and
SELECT lo.course AS Course_ID, co.shortname as Course_ShortName, co.fullname AS Course_FullName, us.firstname as Instructor_FirstName, us.lastname AS Instructor_LastName, COUNT(DISTINCT(FROM_UNIXTIME(lo.time, '%Y-%m-%d'))) AS Days_Logged_In
FROM prefix_log lo
INNER JOIN prefix_course co ON (co.id = lo.course)
INNER JOIN prefix_user us ON (lo.userid = us.id)
INNER JOIN prefix_role_assignments ra ON (ra.userid = us.id)
INNER JOIN prefix_context ctxt ON (ctxt.id = ra.contextid AND ctxt.instanceid = co.id AND ctxt.contextlevel = 50)
INNER JOIN prefix_role r ON (r.id = ra.roleid)
WHERE lo.course <> 1 AND r.name='Instructor'
AND (FROM_UNIXTIME(lo.time) > '2015-05-03' AND FROM_UNIXTIME(lo.time) < '2015-05-09') AND (co.shortname LIKE '%15/UA%' OR co.shortname LIKE '%15/UB%')
GROUP BY us.firstname, us.lastname, Course_ID, Course_ShortName, Course_FullName
ORDER BY co.fullname, co.shortname
Is there any database level changes in 2.7 that would prevent these queries to run correctly? Thanks again for your help!!!