diff --git a/core/lib/Thelia/Action/Country.php b/core/lib/Thelia/Action/Country.php index 1fa90b6b9..f4f59b2bb 100644 --- a/core/lib/Thelia/Action/Country.php +++ b/core/lib/Thelia/Action/Country.php @@ -29,6 +29,7 @@ use Thelia\Core\Event\Country\CountryDeleteEvent; use Thelia\Core\Event\Country\CountryUpdateEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Model\Country as CountryModel; +use Thelia\Model\CountryQuery; /** @@ -62,7 +63,11 @@ class Country extends BaseAction implements EventSubscriberInterface public function delete(CountryDeleteEvent $event) { + if (null !== $country = CountryQuery::create()->findPk($event->getCountryId())) { + $country->delete(); + $event->setCountry($country); + } } diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index 47208fdb4..c69c0659d 100755 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -420,6 +420,10 @@ \d+ + + Thelia\Controller\Admin\CountryController::deleteAction + + Thelia\Controller\Admin\ContentController::createAction diff --git a/templates/admin/default/countries.html b/templates/admin/default/countries.html index 21d3819e4..3207357a1 100644 --- a/templates/admin/default/countries.html +++ b/templates/admin/default/countries.html @@ -216,10 +216,17 @@ {/javascripts}