My custom enrollment method is not working

My custom enrollment method is not working

Abdulaziz Redi -
回帖数:1

I was using Moodle Lms 4.5 to create a class but when I tried to add my own enrol plugin it is not showing up in the enrollment methods list and it shows this error.
Capability "enrol/inverse:config" was not found! This has to be fixed in code.

  • line 458 of /lib/accesslib.php: call to debugging()
  • line 142 of /enrol/inverse/lib.php: call to has_capability()
  • line 282 of /enrol/instances.php: call to enrol_inverse_plugin->can_add_instance()
附件 Screenshot from 2024-11-04 15-25-09 (1).png
附件 Screenshot from 2024-11-04 15-25-09.png
回复Abdulaziz Redi

Re: My custom enrollment method is not working

Davo Smith -
Core developers的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 Plugin developers的头像
Hard to fully diagnose without a link to see the code of your enrolment plugin, but the error seems pretty clear - your plugin's db/access.php file doesn't define a capability called 'enrol/inverse:config' - https://moodledev.io/docs/4.4/apis/subsystems/access#how-to-define-new-capabilities-in-plugins

If that is present, you may need to increase the version number in your version.php file, in order to tell Moodle to re-load the definitions in that file.