-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
2.5, 2.6, 2.9.5, 3.0.5
-
MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
This issue is related to MDL-41516.
Attempting to add jquery from a filter's filter.php file using:
public function setup($page, $context) {
|
static $jsinitialised = false;
|
if (!$jsinitialised) {
|
$page->requires->jquery();
|
$jsinitialised = true;
|
}
|
}
|
results in the following PHP error:
Can not add jQuery plugins after starting page output!
|
line 397 of /lib/outputrequirementslib.php: call to debugging()
|
line 341 of /lib/outputrequirementslib.php: call to page_requirements_manager->jquery_plugin()
|
line 56 of /filter/rein/filter.php: call to page_requirements_manager->jquery()
|
line 255 of /lib/filterlib.php: call to filter_rein->setup()
|
line 1120 of /lib/weblib.php: call to filter_manager->setup_page_for_filters()
|
line 74 of /filter/rein/renderer.php: call to format_text()
|
line 94 of /filter/rein/debug.php: call to filter_rein_renderer->print_debug_accordion()
|
When the following is tried:
public function get_required_javascript() {
|
parent::get_required_javascript();
|
$this->page->requires->jquery();
|
}
|
there is no error and jQuery is not loaded to the page.
- has been marked as being related by
-
MDL-41516 jQuery libraries cannot be included in blocks when themes have a call to 'body_attributes()'
-
- Closed
-