kaltura / moodle_plugin

8 stars 37 forks source link

Cannot do fresh install of Moodle with Kaltura plugins #357

Open haietza opened 2 years ago

haietza commented 2 years ago

The version.php file includes the code:

$localKalturaPluginVersionRecord = $DB->get_records_select('config_plugins', "plugin = 'local_kaltura' AND name = 'version'");

This code attempts to access the config_plugins table, which has not been created yet on a fresh install of Moodle. I'm thinking this (and other version check code in the version.php file) probably belong in update.php?

lucaboesch commented 2 years ago

It would be helpful if you specified which version.php file exactly, @haietza .

haietza commented 2 years ago

@lucaboesch I apologize, I forgot all the plugins were included in this repo. It is the MOODLE_311_DEV branch of the local_kaltura plugin version file. Thank you!

davosmith commented 2 years ago

We're hitting exactly the same problem for one of our customer sites.

version.php files can get accessed from all sorts of places, for a great number of reasons - it is a really, really terrible idea to be doing any sort of DB query within the version.php file.

At the very least this entire section of version.php file should be wrapped in a try-catch block to prevent fatal errors (but, ideally, this should be removed completely).