From 7ac2970affb641bd7df59fcd9620a9462defb45d Mon Sep 17 00:00:00 2001 From: PrestaEdit Date: Sun, 25 Nov 2012 23:08:47 +0100 Subject: [PATCH] // PSCFV-5569: remove warning if module "blocksuppliers" and "blockmanufacturer" is deleted --- controllers/front/SitemapController.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/controllers/front/SitemapController.php b/controllers/front/SitemapController.php index aaa72b560..b064575cd 100644 --- a/controllers/front/SitemapController.php +++ b/controllers/front/SitemapController.php @@ -47,10 +47,22 @@ class SitemapControllerCore extends FrontController $this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1)); $this->context->smarty->assign('voucherAllowed', (int)CartRule::isFeatureActive()); - $blockmanufacturer = Module::getInstanceByName('blockmanufacturer'); - $blocksupplier = Module::getInstanceByName('blocksupplier'); - $this->context->smarty->assign('display_manufacturer_link', (bool)$blockmanufacturer->active); - $this->context->smarty->assign('display_supplier_link', (bool)$blocksupplier->active); + if(Module::isInstalled('blockmanufacturer')) + { + $blockmanufacturer = Module::getInstanceByName('blockmanufacturer'); + $this->context->smarty->assign('display_manufacturer_link', (bool)$blockmanufacturer->active); + } + else + $this->context->smarty->assign('display_manufacturer_link', 0); + + if(Module::isInstalled('blocksupplier')) + { + $blocksupplier = Module::getInstanceByName('blocksupplier'); + $this->context->smarty->assign('display_supplier_link', (bool)$blocksupplier->active); + } + else + $this->context->smarty->assign('display_supplier_link', 0); + $this->context->smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS')); $this->context->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));