ronefel / moodle-mod_googlemeet

Google Meet resource module plugin for Moodle 3.7+
Other
20 stars 15 forks source link

Undefined constant "MESSAGE_DEFAULT_ENABLED" #36

Open leonstr opened 1 year ago

leonstr commented 1 year ago

Installing this plugin with Moodle 3.11 fails with:

Exception - Undefined constant "MESSAGE_DEFAULT_ENABLED"

More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:

    line 30 of /mod/googlemeet/db/messages.php: Error thrown
    line 708 of /lib/messagelib.php: call to require()
    line 421 of /lib/messagelib.php: call to message_get_providers_from_file()
    line 863 of /lib/upgradelib.php: call to message_update_providers()
    line 576 of /lib/upgradelib.php: call to upgrade_plugins_modules()
    line 1929 of /lib/upgradelib.php: call to upgrade_plugins()
    line 713 of /admin/index.php: call to upgrade_noncore()
leonstr commented 1 year ago

mod_googlemeet aee7f41 uses MESSAGE_DEFAULT_ENABLED but this was only introduced in Moodle 4.0 (MDL-67853).

For Moodle 3.11 you can work around this issue by editing mod/googlemeet/db/messages.php changing lines 30 and 31 to:

            'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
            'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,