From 9ca612ae0dbe56dec335ba5b39a62cdccf1dcd27 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 21 Oct 2013 11:54:15 +0200 Subject: [PATCH] not allowed to delete default country --- core/lib/Thelia/Model/Country.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/lib/Thelia/Model/Country.php b/core/lib/Thelia/Model/Country.php index e254d4a5e..13d706839 100755 --- a/core/lib/Thelia/Model/Country.php +++ b/core/lib/Thelia/Model/Country.php @@ -47,6 +47,10 @@ class Country extends BaseCountry public function preDelete(ConnectionInterface $con = null) { + if($this->getByDefault()) { + return false; + } + $this->dispatchEvent(TheliaEvents::BEFORE_DELETECOUNTRY, new CountryEvent($this)); return true;