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

SQL Error when editing the Custom Certificate Activity #520

Closed
UncleRaymondo opened this issue Oct 28, 2022 · 2 comments
Closed

SQL Error when editing the Custom Certificate Activity #520

UncleRaymondo opened this issue Oct 28, 2022 · 2 comments

Comments

@UncleRaymondo
Copy link

UncleRaymondo commented Oct 28, 2022

Hi @mdjnelson,

I'm not sure if this is because I haven't issued any certificates yet (still designing and testing), but when I edit the Custom Certificate activity, I get the following SQL Error

Error Reading From Database:

Debug info: Unknown column 'uf1d_1.data' in 'field list'
SELECT u.id, u.picture, u.firstname, u.lastname, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.imagealt, u.email, uf1d_1.data AS profile_field_studentid, ci.id as issueid, ci.code, ci.timecreated
FROM mdl_user u
INNER JOIN mdl_customcert_issues ci
ON u.id = ci.userid
WHERE u.deleted = 0
AND ci.customcertid = ?
AND NOT u.id IN (?,?)
ORDER BY CONCAT(firstname, ' ', lastname) LIMIT 0, 50
[array (
0 => '2',
1 => 35,
2 => 13,
)]
Error code: dmlreadexception 
Stack trace:

    line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
    line 1273 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
    line 291 of /mod/customcert/classes/certificate.php: call to mysqli_native_moodle_database->get_records_sql()
    line 204 of /mod/customcert/classes/report_table.php: call to mod_customcert\certificate::get_issues()
    line 2091 of /lib/tablelib.php: call to mod_customcert\report_table->query_db()
    line 158 of /mod/customcert/view.php: call to table_sql->out()

Any ideas why this might be the case?

It's visible on the page /mod/customcert/view.php?id=1965&group=0

This is Moodle 3.11.10+ on PHP 7.4

Appreciate the assist :)

Cheers,
Ray

@leonstr
Copy link
Contributor

leonstr commented Nov 3, 2022

Have you got mod_customcert downloaded from the Moodle plugins directory? Or is it the version from this repo which has additional fixes? Because of the line numbers in the stack trace I suspect it's the former so I suggest trying the version from GitHub.

This issue looks like #465 which is fixed for Moodle 3.11 (but not in the version in the plugins directory). A note of caution: it sounds like this issue has become broken again for Moodle 4.0, see #512.

@mdjnelson
Copy link
Owner

Closing as I believe @leonstr is correct.

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

3 participants