Index: install/install_toolkit.php =================================================================== --- install/install_toolkit.php (revision 13367) +++ install/install_toolkit.php (working copy) @@ -310,8 +310,10 @@ $sqls = str_replace('CREATE TABLE ', 'CREATE TABLE IF NOT EXISTS ' . $table_prefix, $sqls); $sqls = str_replace('DROP TABLE ', 'DROP TABLE IF EXISTS ' . $table_prefix, $sqls); $sqls = str_replace('<%TABLE_PREFIX%>', $table_prefix, $sqls); - $sqls = str_replace('<%PRIMARY_LANGUAGE%>', $this->Application->GetDefaultLanguageId(), $sqls); + $primary_language = is_object($this->Application) ? $this->Application->GetDefaultLanguageId() : 1; + $sqls = str_replace('<%PRIMARY_LANGUAGE%>', $primary_language, $sqls); + if (isset($replace_from) && isset($replace_to)) { // replace something additionally, e.g. module root category $sqls = str_replace($replace_from, $replace_to, $sqls);