// fixed bug #PSTEST-552

// Clean code
This commit is contained in:
aFolletete
2012-02-14 15:08:40 +00:00
parent 216c26b891
commit 8c0b86ac46
3 changed files with 121 additions and 78 deletions
+6 -3
View File
@@ -2310,11 +2310,14 @@ class AdminControllerCore extends Controller
if (!$type)
return;
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.$this->table.'_'.$type.($id_object ? ' WHERE `'.$this->identifier.'`='.(int)$id_object : ''));
Db::getInstance()->execute('
DELETE FROM '._DB_PREFIX_.$this->table.'_'.$type.($id_object ? '
WHERE `'.$this->identifier.'`='.(int)$id_object : ''));
foreach ($assos as $asso)
Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.$this->table.'_'.$type.' (`'.pSQL($this->identifier).'`, id_'.$type.')
VALUES('.($new_id_object ? $new_id_object : (int)$asso['id_object']).', '.(int)$asso['id_'.$type].')');
Db::getInstance()->execute('
INSERT INTO '._DB_PREFIX_.$this->table.'_'.$type.' (`'.pSQL($this->identifier).'`, id_'.$type.')
VALUES('.($new_id_object ? $new_id_object : (int)$asso['id_object']).', '.(int)$asso['id_'.$type].')');
}
protected function validateField($value, $field)