Commit 1968412b authored by Robert Lyon's avatar Robert Lyon
Browse files

Double call of language_select_form() throws error (bug #1286941)



Some things like die_info() will try and create a smarty() call when
we are already in one, which causes language_select_form() to throw
headdata error as it is called twice and can't be due to the form
having a select field in it and select fields love to add data to the
$HEADDATA.

Made it so that it is only called once.

Change-Id: Ie2099dfc1990c8bd2a039bdd33869d9b65c156f1
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 85af3276
......@@ -44,7 +44,7 @@ function smarty_core() {
*/
function smarty($javascript = array(), $headers = array(), $pagestrings = array(), $extraconfig = array()) {
global $USER, $SESSION, $THEME, $HEADDATA;
global $USER, $SESSION, $THEME, $HEADDATA, $langselectform;
if (!is_array($headers)) {
$headers = array();
......@@ -57,8 +57,11 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
}
$SIDEBLOCKS = array();
$langselectform = language_select_form();
// Some things like die_info() will try and create a smarty() call when we are already in one, which causes
// language_select_form() to throw headdata error as it is called twice.
if (!isset($langselectform)) {
$langselectform = language_select_form();
}
$smarty = smarty_core();
$wwwroot = get_config('wwwroot');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment