// Fix #PSFV-34

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7784 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie committed 2011-07-28 13:43:56 +00:00
1 parent 77603244c0
commit 6a99789015
1 file changed
+7 -4
+7 -4
View File
@@ -135,11 +135,14 @@ class FeatureCore extends ObjectModel
foreach (array_keys($field) as $key) foreach (array_keys($field) as $key)
if (!Validate::isTableOrIdentifier($key)) if (!Validate::isTableOrIdentifier($key))
die(Tools::displayError()); die(Tools::displayError());
$mode = Db::getInstance()->getRow('SELECT `id_lang` FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang` WHERE `'.pSQL($this->identifier).
'` = '.(int)($this->id).' AND `id_lang` = '.(int)($field['id_lang'])); $sql = 'SELECT `id_lang` FROM `'.pSQL(_DB_PREFIX_.$this->table).'_lang`
$result *= (!Db::getInstance()->NumRows()) ? Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'INSERT') : WHERE `'.pSQL($this->identifier).'` = '.(int)$this->id.'
AND `id_lang` = '.(int)$field['id_lang'];
$mode = Db::getInstance()->getRow($sql);
$result &= (!$mode) ? Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'INSERT') :
Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', '`'. Db::getInstance()->AutoExecute(_DB_PREFIX_.$this->table.'_lang', $field, 'UPDATE', '`'.
pSQL($this->identifier).'` = '.(int)($this->id).' AND `id_lang` = '.(int)($field['id_lang'])); pSQL($this->identifier).'` = '.(int)$this->id.' AND `id_lang` = '.(int)$field['id_lang']);
} }
return $result; return $result;
} }