Skip to content

Commit 9796040

Browse files
ferishilibluetom
authored andcommitted
gracefully handle exception in the setting when the tool plugin is not ready yet
1 parent 09503d9 commit 9796040

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

classes/settings/upload_settings_helper.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,15 @@ private static function add_processing_tab_settings(mod_opencast_admin_settingsp
249249
self::add_heading($settings, $tabname, $ocinstanceid);
250250

251251
$disabled = false;
252-
if (!(defined('BEHAT_UTIL') && BEHAT_UTIL) && !(defined('PHPUNIT_UTIL') && PHPUNIT_UTIL)) {
253-
$wfconfighelper = workflowconfiguration_helper::get_instance($ocinstanceid);
254-
if (!$wfconfighelper->can_provide_configuration_panel()) {
255-
$disabled = true;
252+
if (!(defined('BEHAT_UTIL') && BEHAT_UTIL) && !(defined('PHPUNIT_UTIL') && PHPUNIT_UTIL) && !during_initial_install()) {
253+
try {
254+
$wfconfighelper = workflowconfiguration_helper::get_instance($ocinstanceid);
255+
if (!$wfconfighelper->can_provide_configuration_panel()) {
256+
$disabled = true;
257+
}
258+
} catch (\Throwable $e) {
259+
// We want this to NOT throw error at this point, when it does we just disable the feature.
260+
$disabled = false;
256261
}
257262
}
258263

0 commit comments

Comments
 (0)