Skip to content

Commit 155aa78

Browse files
committed
Bug fix: nested user-interface-wrappers gave JavaScript errors when ctrl-alt-M was used to disable then restart all UIs.
1 parent 75c9711 commit 155aa78

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

amd/build/userinterfacewrapper.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/userinterfacewrapper.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/src/userinterfacewrapper.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,13 @@ define(['jquery', 'core/templates', 'core/notification'], function($, Templates,
225225
if (t.uiInstance !== null || t.loadFailed) {
226226
t.stop();
227227
} else {
228-
t.restart(); // Reactivate
228+
// If the wrapper still exists (which won't be the case for
229+
// userinterfacewrappers embedded within another userinterface wrapper)
230+
// restart the UI within the wrapper.
231+
const wrapper = document.getElementById(`${t.taId}_wrapper`);
232+
if (wrapper) {
233+
t.restart(); // Reactivate
234+
}
229235
}
230236
}
231237
});

version.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
defined('MOODLE_INTERNAL') || die();
2424

25-
$plugin->version = 2024031500;
25+
$plugin->version = 2024070500;
2626
$plugin->requires = 2022041900;
2727
$plugin->cron = 0;
2828
$plugin->component = 'qtype_coderunner';

0 commit comments

Comments
 (0)