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

Type parameter missing in save() #11

Closed
christianwolters opened this issue Feb 2, 2021 · 5 comments
Closed

Type parameter missing in save() #11

christianwolters opened this issue Feb 2, 2021 · 5 comments

Comments

@christianwolters
Copy link
Member

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 #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

@christianwolters christianwolters changed the title Type para Type parameter missing in save() Feb 2, 2021
@bendec
Copy link

bendec commented Feb 10, 2021

We also have this problem and at this time we resolve it in the DB when it occurs.

@christianwolters
Copy link
Member Author

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

@bendec
Copy link

bendec commented Feb 10, 2021

Thanks! We will do this.

@lucaboesch
Copy link
Contributor

This has been released with v3.11-r1
Thanks, Christian!

@krostas1983
Copy link

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

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

4 participants