public function delete() { parent::delete(); /* * If we have deleted the active language, we get an error, so we set the * language in the session to the primary lang */ $nooku = KFactory::get('admin::com.nooku.model.nooku'); $lang = $nooku->getPrimaryLanguage()->iso_code; $nooku->setLanguage($lang); }