• Customer

    Solution for Ovic Layout Control displaying not active modules

    Posted by: comprope Dec 3, 2015 at 13:57 (9 year ago)
    Hi,
    I've realized that Ovic Layout Control was showing modules even thoguh they were disabled in backoffice.
    After reviewing the code, I found that the problem is here:

    File: modules\oviclayoutcontrol\oviclayoutcontrol.php
    Function: private function generalHook($hookname)

    $optionModules = self::getModulesHook($curent_id_option, $hookname);
    if (!is_null($optionModules['modules']))
    $optionModules = Tools::jsonDecode($optionModules['modules'],true);
    else
    $optionModules = array();
    if ($optionModules && is_array($optionModules) && sizeof($optionModules)>0){
    foreach ($optionModules as $optionModule){
    $moduleObject = Module::getInstanceByName($optionModule[0]);
    $html .= $this->ModuleHookExec($moduleObject, $optionModule[1]);
    }
    }
    return $html;

    Modules is being loaded but without checking it is installed or even enabled.
    For me, the solution was this:

    $optionModules = self::getModulesHook($curent_id_option, $hookname);
    if (!is_null($optionModules['modules']))
    $optionModules = Tools::jsonDecode($optionModules['modules'],true);
    else
    $optionModules = array();
    if ($optionModules && is_array($optionModules) && sizeof($optionModules)>0){
    foreach ($optionModules as $optionModule){
    if(Module::isEnabled($optionModule[0])) {
    $moduleObject = Module::getInstanceByName($optionModule[0]);
    $html .= $this->getModuleAssign($moduleObject, $optionModule[1]);
    }
    }
    }
    return $html;

    PD: I've check last release of theme and it hasn't been fixed, so I'm sharing this solutions for those that would may need it.

    Regards.

INSTALLATION SERVICE

Theme Installation: $49. Pay now

CUSTOMIZED SERVICES

Use our expert service to turn your ideas into reality. Please send an email to kutethemes@gmail.com to provide the more detailed information. Thanks!

WORKING TIME

Our support service works from Monday to Friday.
Mean time (GMT +7):
+ 7:30 - 11:30 AM
+ 1:30 - 5:30 PM
We will try to answer all the questions within 24 hours and solve them as quickly as possible