MDL-57101 filter: Always set-up the page for filters

This commit is contained in:
Frederic Massart 2016-11-29 11:40:10 +08:00
parent a174f2474f
commit e37c128686
No known key found for this signature in database
GPG Key ID: AC343CE142B12FB9
3 changed files with 7 additions and 0 deletions

View File

@ -1599,6 +1599,11 @@ class moodle_page {
$OUTPUT = $this->get_renderer('core', null, $target);
}
if (!during_initial_install()) {
$filtermanager = filter_manager::instance();
$filtermanager->setup_page_for_filters($this, $this->context);
}
$this->_wherethemewasinitialised = debug_backtrace();
}

View File

@ -451,6 +451,7 @@ class core_coursecatlib_testcase extends advanced_testcase {
try {
// Enable the multilang filter and set it to apply to headings and content.
filter_manager::reset_caches();
filter_set_global_state('multilang', TEXTFILTER_ON);
filter_set_applies_to_strings('multilang', true);
$expected = array($c3, $c4, $c1, $c2);

View File

@ -892,6 +892,7 @@ EOF;
get_mimetype_description(array('filename' => 'test.frog')));
// Test custom description using multilang filter.
filter_manager::reset_caches();
filter_set_global_state('multilang', TEXTFILTER_ON);
filter_set_applies_to_strings('multilang', true);
core_filetypes::update_type('frog', 'frog', 'application/x-frog', 'document',