Closed christianwolters closed 3 years ago
We also have this problem and at this time we resolve it in the DB when it occurs.
Hi @bendec,
you may want to look at the PR: https://github.com/moodleuulm/moodle-availability_password/pull/10/files
It is a really small change you may want to implement as a hotfix on your server.
Cheers Christian
Thanks! We will do this.
This has been released with v3.11-r1 Thanks, Christian!
This issue is still present in v3.9-r3 (actually every release but v3.11-r1). Would be cool if it could be fixed there as well.
As far as I can see, @christianwolters patch / pull request is applicable there as well.
Cheers
Hi @ll,
the parameter type is missing in https://github.com/moodleuulm/moodle-availability_password/blob/63d662bedf4d1e026917957127b0b8064415c1f3/classes/condition.php#L184
I created a small PR https://github.com/moodleuulm/moodle-availability_password/pull/10
Without this parameter backup/restore is broken, when this availability is used together with other access restrictions, e.g. the relevant part of the json looks like:
"c":[{"password":"PROBE"},{"type":"completion","cm":470,"e":1},{"type":"completion","cm":472,"e":1},{"type":"completion","cm":472,"e":1}] -> no type in first element -> Moodle does not know how to handle this and complains with invalid availability structure error.
Cheers Christian