Merge pull request #11896 from tuxgasy/10.0_childtablesoncascade_isempty
Check if childtablesoncascade is not empty
This commit is contained in:
commit
f946ec0563
@ -7536,6 +7536,7 @@ abstract class CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Delete cascade first
|
// Delete cascade first
|
||||||
|
if (! empty($this->childtablesoncascade)) {
|
||||||
foreach($this->childtablesoncascade as $table)
|
foreach($this->childtablesoncascade as $table)
|
||||||
{
|
{
|
||||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id;
|
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$table.' WHERE '.$this->fk_element.' = '.$this->id;
|
||||||
@ -7547,6 +7548,7 @@ abstract class CommonObject
|
|||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user