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

Error when deleting a cohort #32

Open
seb-vial opened this issue Aug 30, 2022 · 2 comments
Open

Error when deleting a cohort #32

seb-vial opened this issue Aug 30, 2022 · 2 comments

Comments

@seb-vial
Copy link

Hello,

An error occurs when trying to delete a cohort from Moodle
Exception : Undefined constant "metadatacontext_cohort\CONTEXT_COHORT"

Following the trace, it appears indeed that this constant is not defined but used in /local/metadata/context/cohort/classes/observer.php

This constant is defined in /local/metadata/context/cohort/classes/context_handler.php. Defining it in the observer file fixes the issue. Is this the best way though ? Would there be consequences ?

@seb-vial
Copy link
Author

seb-vial commented Sep 9, 2022

This issue impacts group context as well. I had the same error when deleting a group; but of course the missing constant is not the same (CONTEXT_GROUP) in /local/metadata/context/group/classes/observer.php.
Other contexts should be fine as there is an existing context constant for each of them in Moodle core.

@leonstr
Copy link

leonstr commented Dec 22, 2022

Submitted pull request #35 to fix this.

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