From a5ab1d5bc2ab3e783ac9b7381f3f9df852c623f4 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Wed, 2 Jan 2013 17:47:49 +0100 Subject: [PATCH] //small fix when disabled language with bulk action --- controllers/admin/AdminLanguagesController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/controllers/admin/AdminLanguagesController.php b/controllers/admin/AdminLanguagesController.php index aec4648ef..a275a4d14 100644 --- a/controllers/admin/AdminLanguagesController.php +++ b/controllers/admin/AdminLanguagesController.php @@ -512,6 +512,21 @@ class AdminLanguagesControllerCore extends AdminController //update employee lang if current id lang is disabled Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'employee` set `id_lang`='.(int)Configuration::get('PS_LANG_DEFAULT').' WHERE `id_lang`='.(int)$current_id_lang); } + + protected function processBulkStatusSelection($status) + { + if (!$status)//only check if status == 0 (disable) + { + if (is_array($this->boxes) && !empty($this->boxes)) + foreach ($this->boxes as $id) + if (Configuration::get('PS_LANG_DEFAULT') == $id) + $this->errors[] = $this->l('You cannot change the status of the default language.'); + if (!count($this->errors)) + parent::processBulkStatusSelection($status); + } + else + parent::processBulkStatusSelection($status); + } }