MDL-76975 admin: Move AMD dependencies to data attribute to fix overflow
Since there is a 1024 length limit on arguments passed through js_call_amd(), we pass it through a HTML element dataset to avoid this limit.
This commit is contained in:
+2
-4
@@ -165,10 +165,8 @@ if (empty($SITE->fullname)) {
|
||||
$PAGE->requires->js_call_amd('core_form/changechecker', 'watchFormById', ['adminsettings']);
|
||||
|
||||
if ($settingspage->has_dependencies()) {
|
||||
$opts = [
|
||||
'dependencies' => $settingspage->get_dependencies_for_javascript()
|
||||
];
|
||||
$PAGE->requires->js_call_amd('core/showhidesettings', 'init', [$opts]);
|
||||
$context = ['dependencies' => json_encode($settingspage->get_dependencies_for_javascript())];
|
||||
echo $OUTPUT->render_from_template('core_admin/settings_showhide', $context);
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
Reference in New Issue
Block a user