Fixed customer front controller, events, addec admion config.
This commit is contained in:
@@ -474,7 +474,6 @@ abstract class Category implements ActiveRecordInterface
|
||||
if (!$this->hasVirtualColumn($name)) {
|
||||
throw new PropelException(sprintf('Cannot get value of inexistent virtual column %s.', $name));
|
||||
}
|
||||
|
||||
return $this->virtualColumns[$name];
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,33 @@ use Thelia\Model\Base\Lang as BaseLang;
|
||||
|
||||
class Lang extends BaseLang {
|
||||
|
||||
/**
|
||||
* Return the default language object, using a local variable to cache it.
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
private static $default_lang = null;
|
||||
|
||||
public static function getDefaultLanguage() {
|
||||
|
||||
if (self::$default_lang == null) {
|
||||
$default_lang = LangQuery::create()->findOneByByDefault(true);
|
||||
|
||||
if ($default_lang == null) throw new RuntimeException("No default language is defined. Please define one.");
|
||||
}
|
||||
|
||||
return $default_lang;
|
||||
}
|
||||
|
||||
public function getDateFormat() {
|
||||
return "d/m/Y";
|
||||
}
|
||||
|
||||
public function getTimeFormat() {
|
||||
return "H:i:s";
|
||||
}
|
||||
|
||||
public function getDateTimeFormat() {
|
||||
return "d/m/Y H:i:s";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use Propel\Runtime\ActiveQuery\Join;
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Thelia\Model\Base\LangQuery;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Model\Lang;
|
||||
|
||||
/**
|
||||
* Class ModelCriteriaTools
|
||||
@@ -52,7 +53,7 @@ class ModelCriteriaTools
|
||||
$search->withColumn('`' . $requestedLocaleI18nAlias . '`.`' . $column . '`', $aliasPrefix . 'i18n_' . $column);
|
||||
}
|
||||
} else {
|
||||
$defaultLocale = LangQuery::create()->findOneById($defaultLangWithoutTranslation)->getLocale();
|
||||
$defaultLocale = Lang::getDefaultLanguage()->getLocale();
|
||||
|
||||
$defaultLocaleJoin = new Join();
|
||||
$defaultLocaleJoin->addExplicitCondition($search->getTableMap()->getName(), $foreignKey, null, $foreignTable . '_i18n', 'ID', $defaultLocaleI18nAlias);
|
||||
|
||||
Reference in New Issue
Block a user