// Fix during language install (now support table with uppercase prefix on windows)
// Add is_native to hook table in db.sql file git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9989 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -364,7 +364,8 @@ class LanguageCore extends ObjectModel
|
|||||||
foreach($columns as $column)
|
foreach($columns as $column)
|
||||||
$fields .= $column['Field'].', ';
|
$fields .= $column['Field'].', ';
|
||||||
$fields = rtrim($fields, ', ');
|
$fields = rtrim($fields, ', ');
|
||||||
$identifier = 'id_'.str_replace('_lang', '', str_replace(_DB_PREFIX_, '', $name));
|
preg_match('#^'.preg_quote(_DB_PREFIX_).'(.+)_lang$#i', $name, $m);
|
||||||
|
$identifier = 'id_'.$m[1];
|
||||||
|
|
||||||
$sql = 'INSERT IGNORE INTO `'.$name.'` ('.$fields.') (SELECT ';
|
$sql = 'INSERT IGNORE INTO `'.$name.'` ('.$fields.') (SELECT ';
|
||||||
foreach($columns as $column) {
|
foreach($columns as $column) {
|
||||||
|
|||||||
@@ -254,9 +254,8 @@ abstract class ObjectModelCore
|
|||||||
if (!Shop::isFeatureActive())
|
if (!Shop::isFeatureActive())
|
||||||
{
|
{
|
||||||
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'shop')
|
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'shop')
|
||||||
{
|
|
||||||
$result &= $this->associateTo(Context::getContext()->shop->getID(true), 'shop');
|
$result &= $this->associateTo(Context::getContext()->shop->getID(true), 'shop');
|
||||||
}
|
|
||||||
$assos = GroupShop::getAssoTables();
|
$assos = GroupShop::getAssoTables();
|
||||||
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'group_shop')
|
if (isset($assos[$this->table]) && $assos[$this->table]['type'] == 'group_shop')
|
||||||
$result &= $this->associateTo(Context::getContext()->shop->getGroupID(), 'group_shop');
|
$result &= $this->associateTo(Context::getContext()->shop->getGroupID(), 'group_shop');
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class ShopCore extends ObjectModel
|
|||||||
protected $identifier = 'id_shop';
|
protected $identifier = 'id_shop';
|
||||||
|
|
||||||
/** @var array List of shops cached */
|
/** @var array List of shops cached */
|
||||||
protected static $shops = array();
|
protected static $shops;
|
||||||
|
|
||||||
private static $asso_tables = array(
|
private static $asso_tables = array(
|
||||||
'carrier' => array('type' => 'shop'),
|
'carrier' => array('type' => 'shop'),
|
||||||
@@ -403,9 +403,11 @@ class ShopCore extends ObjectModel
|
|||||||
*/
|
*/
|
||||||
public static function cacheShops($refresh = false)
|
public static function cacheShops($refresh = false)
|
||||||
{
|
{
|
||||||
if (self::$shops && !$refresh)
|
if (!is_null(self::$shops) && !$refresh)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
self::$shops = array();
|
||||||
|
|
||||||
$select = '';
|
$select = '';
|
||||||
$from = '';
|
$from = '';
|
||||||
$where = '';
|
$where = '';
|
||||||
|
|||||||
@@ -783,6 +783,7 @@ CREATE TABLE `PREFIX_hook` (
|
|||||||
`description` text,
|
`description` text,
|
||||||
`position` tinyint(1) NOT NULL default '1',
|
`position` tinyint(1) NOT NULL default '1',
|
||||||
`live_edit` tinyint(1) NOT NULL default '0',
|
`live_edit` tinyint(1) NOT NULL default '0',
|
||||||
|
`is_native` tinyint(1) NOT NULL default '0',
|
||||||
PRIMARY KEY (`id_hook`),
|
PRIMARY KEY (`id_hook`),
|
||||||
UNIQUE KEY `hook_name` (`name`)
|
UNIQUE KEY `hook_name` (`name`)
|
||||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||||
|
|||||||
Reference in New Issue
Block a user