Hi,
I apologize in advance for cross-posting, but I think that this question is better asked here than in the developer's forum where it was originally posted. Unfortunately I don't have the ability to remove my original post from there.
I am developing a custom block which is to use jquery. I followed the steps in http://docs.moodle.org/dev/jQuery, which is essentially to include the following function in block_blockname.php:
function get_required_javascript() {
parent::get_required_javascript();
$this->page->requires->jquery();
$this->page->requires->jquery_plugin('ui');
$this->page->requires->jquery_plugin('ui-css');
}
It seems to load fine when using any of the older themes (I tested it with every theme in the standard installation and the issue happens only with Clean). With those themes, Firebug shows that it loads up jquery-1.9.1.js, jquery-ui.js, and jquery-ui.css.
Howevery, when I change the theme to "Clean" (the new bootstrap-based theme), I get the following error:
Can not add jQuery plugins after starting page output!
Followed by a bunch of other line and file-specific errors. This happens if I load the block in the frontpage or a course page.
Any ideas? Is this a clean theme bug or am I doing something wrong?
I haven't tested it, but I wonder if it affects all bootstrap themes.
Thanks in advance,
Paul