Skip to content

Commit

Permalink
MDL-44719 libraries: Invalid call to ajaxenabled()
Browse files Browse the repository at this point in the history
A bad conflict resolution in 7eaca5a
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.
  • Loading branch information
Frederic Massart committed Mar 25, 2014
1 parent 9b8555f commit 6538153
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
14 changes: 14 additions & 0 deletions lib/deprecatedlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 3 additions & 4 deletions tag/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit 6538153

Please sign in to comment.