From 062d04cffc5a605c9eeb6fa7b4ceee819b9a4918 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 18 Aug 2014 13:33:01 +0100 Subject: [PATCH] MDL-46867 filter_glossary: don't use static for one-time JS. --- filter/glossary/filter.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/filter/glossary/filter.php b/filter/glossary/filter.php index 016efd6273b..5c4ba448122 100644 --- a/filter/glossary/filter.php +++ b/filter/glossary/filter.php @@ -41,15 +41,12 @@ class filter_glossary extends moodle_text_filter { protected $cacheconceptlist = null; public function setup($page, $context) { - // This only requires execution once per request. - static $jsinitialised = false; - if (empty($jsinitialised)) { + if ($page->requires->should_create_one_time_item_now('filter_glossary_autolinker')) { $page->requires->yui_module( 'moodle-filter_glossary-autolinker', 'M.filter_glossary.init_filter_autolinking', array(array('courseid' => 0))); $page->requires->strings_for_js(array('ok'), 'moodle'); - $jsinitialised = true; } }