Don't attach translation.js when in the maintenance mode

Also not sure but maybe it has something to do with #207.
This commit is contained in:
Fedor A. Fetisov 2017-11-22 14:28:37 +03:00
parent 1c6433eb73
commit 6de62a6929

View File

@ -254,11 +254,15 @@ abstract class AbstractController implements
// Localization file is added as absolute URL because URL Generator
// already prepended base URL to its result.
$this->getAssetManager()->attachJs(
$this->generateUrl('js_translation', array('locale' => get_current_locale())),
AssetManagerInterface::ABSOLUTE_URL,
-1000
);
// Localization file is generated using contents from the database,
// so it should not be attached when in the maintenance mode
if (get_maintenance_mode() === false) {
$this->getAssetManager()->attachJs(
$this->generateUrl('js_translation', array('locale' => get_current_locale())),
AssetManagerInterface::ABSOLUTE_URL,
-1000
);
}
return $this->getStyle()->render($template, $parameters);
}