From 6538153bbd3e2db59350f1f334c6c417974048c8 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 25 Mar 2014 11:27:27 +0800 Subject: [PATCH] MDL-44719 libraries: Invalid call to ajaxenabled() A bad conflict resolution in 7eaca5a810123746cdc69bf04dc7dc32a13533bc wiped this function from the deprecatedlib file. This patch restores it. But as we should not call any deprecated function in core we also remove the its usage. --- lib/deprecatedlib.php | 14 ++++++++++++++ tag/edit.php | 7 +++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index c4d29a965fb23..59cba8dc0b112 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -4335,3 +4335,17 @@ function can_use_html_editor() { debugging('can_use_html_editor has been deprecated please update your code to assume it returns true.', DEBUG_DEVELOPER); return true; } + +/** + * Returns whether ajax is enabled/allowed or not. + * This function is deprecated and always returns true. + * + * @param array $unused - not used any more. + * @return bool + * @deprecated since 2.7 MDL-33099 - please do not use this function any more. + * @todo MDL-44088 This will be removed in Moodle 2.9. + */ +function ajaxenabled(array $browsers = null) { + debugging('ajaxenabled() is deprecated - please update your code to assume it returns true.', DEBUG_DEVELOPER); + return true; +} diff --git a/tag/edit.php b/tag/edit.php index 433d969d7d24b..23efaf91a4ca7 100644 --- a/tag/edit.php +++ b/tag/edit.php @@ -162,8 +162,7 @@ $tagform->display(); -if (ajaxenabled()) { - $PAGE->requires->js('/tag/tag.js'); - $PAGE->requires->js_function_call('init_tag_autocomplete', null, true); -} +$PAGE->requires->js('/tag/tag.js'); +$PAGE->requires->js_function_call('init_tag_autocomplete', null, true); + echo $OUTPUT->footer();