[-] BO: Fix language deletion with multishop when shops still associate to the language #PSCFV-9244

This commit is contained in:
Rémi Gaillard committed 2013-05-24 11:28:07 +02:00
1 parent 377eb8435d
commit 6f901cea37
1 file changed
+3 -3
+3 -3
View File
@@ -466,7 +466,7 @@ class LanguageCore extends ObjectModel
public function delete() public function delete()
{ {
if (!$this->hasMultishopEntries()) if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
{ {
if (empty($this->iso_code)) if (empty($this->iso_code))
$this->iso_code = Language::getIsoById($this->id); $this->iso_code = Language::getIsoById($this->id);
@@ -514,7 +514,7 @@ class LanguageCore extends ObjectModel
if (!parent::delete()) if (!parent::delete())
return false; return false;
if (!$this->hasMultishopEntries()) if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
{ {
// delete images // delete images
$files_copy = array( $files_copy = array(
@@ -831,4 +831,4 @@ class LanguageCore extends ObjectModel
{ {
return (Language::countActiveLanguages() > 1); return (Language::countActiveLanguages() > 1);
} }
} }