MDL-76170 enrol_lti: fix missing secret in enrol_lti_users
commit3e17cf68a4c6e9954fe159568bd276b4d094293b
authorJake Dallimore <jake@moodle.com>
Thu, 3 Nov 2022 03:42:14 +0000 (3 11:42 +0800)
committerJake Dallimore <jake@moodle.com>
Wed, 9 Nov 2022 02:02:22 +0000 (9 10:02 +0800)
tree4b07eca2f02b1511a0948a1fc520cd195e9d21c6
parent5877ae306efaa93a3a0cf8adcedee4da405677f5
MDL-76170 enrol_lti: fix missing secret in enrol_lti_users

If member sync runs before the user launches the tool, a partial record
is created, without consumer secret. Subsequent launches of the tool by
that member don't resolve this and this results in grade sync failing
for any affected users. This patch:
- data fixes the existing affected rows
- fixes the launch code, ensuring secret is recorded on launch,
irrespective of whether the user info record has been created already
or not.
enrol/lti/classes/tool_provider.php
enrol/lti/db/upgrade.php
enrol/lti/version.php