Skip to content
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

Participation by user error #48

Open
mfindlayated opened this issue Jun 12, 2015 · 1 comment
Open

Participation by user error #48

mfindlayated opened this issue Jun 12, 2015 · 1 comment

Comments

@mfindlayated
Copy link

If I click on 'Participation by User, and then enable the 'to date' (leaving as today's date), I see the error listed below when debugging is switched on.

Moodle 2.8.6+
ForumNG: 2015012700 (master branch downloaded from here).

Thanks in advance,
Mark.

Error:

Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'fp.created <= '1434149999'
GROUP BY (fp.userid)) ta
ON u.id ' at line 13
SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.username, COALESCE(ta.numposts, 0) AS numposts, COALESCE(td.numdiscussions, 0) AS numdiscussions
FROM mdl_user u
LEFT JOIN (
SELECT fp.userid, COUNT(fp.userid) AS numposts
FROM mdl_forumng_posts fp
INNER JOIN mdl_forumng_discussions fd ON
fd.id = fp.discussionid
AND fd.postid <> fp.id
WHERE
fd.forumngid = ?
AND fd.deleted = 0
AND fp.deleted = 0
AND fp.oldversion = 0AND fp.created <= ?
GROUP BY (fp.userid)) ta
ON u.id = ta.userid

LEFT JOIN (
SELECT fp.userid, COUNT(fp.userid) AS numdiscussions
FROM mdl_forumng_posts fp
INNER JOIN mdl_forumng_discussions fd ON
fd.postid = fp.id
WHERE
fd.forumngid = ?
AND fd.deleted = 0
AND fp.deleted = 0
AND fp.oldversion = 0AND fp.created <= ?
GROUP BY (fp.userid)) td
ON u.id = td.userid
WHERE u.id IN (SELECT DISTINCT eu1_u.id
FROM mdl_user eu1_u
JOIN mdl_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
JOIN mdl_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = ?)
WHERE eu1_u.deleted = 0 AND eu1_u.id <> ?) ORDER BY u.lastname ASC, u.firstname ASC, u.id ASC LIMIT 0, 100
[array (
0 => '273',
1 => 1434149999,
2 => '273',
3 => 1434149999,
4 => '669',
5 => '1',
)]
Error code: dmlreadexception
Stack trace:
line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 1080 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 208 of /mod/forumng/feature/userposts/list.php: call to mysqli_native_moodle_database->get_records_sql()

@aspark21
Copy link
Contributor

@mfindlayated You should really switch to the MOODLE_28_STABLE branch. The master branch would now be for 2.9.

I'm on the Moodle MOODLE_28_STABLE & ForumNG MOODLE_28_STABLE and can't reproduce this - does it happen in all forums & for all users? or just some?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants