diff -u b/mathjax.module b/mathjax.module --- b/mathjax.module +++ b/mathjax.module @@ -40,7 +40,6 @@ * Implements hook_library_info_build(). */ function mathjax_library_info_build() { - global $base_url; $config = Drupal::config('mathjax.settings'); $libraries = []; $libraries['source'] = [ @@ -56,7 +55,7 @@ ]; if ($config->get('use_cdn') == FALSE) { $libraries['source']['js'] = [ - $base_url . '/libraries/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' => [ + \Drupal::request()->getBaseUrl() . '/libraries/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' => [ 'type' => 'external', 'minified' => TRUE, ], only in patch2: unchanged: --- a/src/Form/MathjaxSettingsForm.php +++ b/src/Form/MathjaxSettingsForm.php @@ -130,7 +130,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ->set('config_type', $form_state->getValue('config_type')) ->set('config_string', $form_state->getValue('config_string')) ->save(); - + drupal_flush_all_caches(); parent::submitForm($form, $form_state); }