Jump to content

getInstanceByName is not able to locate the module


Recommended Posts

Hi,
after the update of translation of a module I have gotten this error:

Symfony\Component\Debug\Exception\FatalThrowableError:

Call to a member function isUsingNewTranslationSystem() on null

  at src/Adapter/Translations/TranslationRouteFinder.php:208
  at PrestaShop\PrestaShop\Adapter\Translations\TranslationRouteFinder->isModuleUsingNewTranslationSystem('0')
     (src/Adapter/Translations/TranslationRouteFinder.php:128)
  at PrestaShop\PrestaShop\Adapter\Translations\TranslationRouteFinder->findRoute(object(ParameterBag))
     (src/PrestaShopBundle/Controller/Admin/TranslationsController.php:127)
  at PrestaShopBundle\Controller\Admin\TranslationsController->modifyTranslationsAction(object(Request))
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, false)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, false)
     (admin951tsdm3z/index.php:88)

 

The code impacted (src/Adapter/Translations/TranslationRouteFinder.php:208) is:

 private function isModuleUsingNewTranslationSystem($moduleName)
    {
        $module = $this->moduleRepository->getInstanceByName($moduleName);
        if (is_null($module))
            return true;
        return $module->isUsingNewTranslationSystem();
    }

It happens trying to change translation for modules (only for them) therefore I deduce that the getInstanceByName is not able to locate the modules.

What could be happened? There is a specific cache for modules to be clean?

 

Link to comment
Share on other sites

On 1/21/2019 at 11:44 PM, Dixin said:

Hi,
after the update of translation of a module I have gotten this error:

Symfony\Component\Debug\Exception\FatalThrowableError:

Call to a member function isUsingNewTranslationSystem() on null

  at src/Adapter/Translations/TranslationRouteFinder.php:208
  at PrestaShop\PrestaShop\Adapter\Translations\TranslationRouteFinder->isModuleUsingNewTranslationSystem('0')
     (src/Adapter/Translations/TranslationRouteFinder.php:128)
  at PrestaShop\PrestaShop\Adapter\Translations\TranslationRouteFinder->findRoute(object(ParameterBag))
     (src/PrestaShopBundle/Controller/Admin/TranslationsController.php:127)
  at PrestaShopBundle\Controller\Admin\TranslationsController->modifyTranslationsAction(object(Request))
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, false)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, false)
     (admin951tsdm3z/index.php:88)

 

The code impacted (src/Adapter/Translations/TranslationRouteFinder.php:208) is:

 private function isModuleUsingNewTranslationSystem($moduleName)
    {
        $module = $this->moduleRepository->getInstanceByName($moduleName);
        if (is_null($module))
            return true;
        return $module->isUsingNewTranslationSystem();
    }

It happens trying to change translation for modules (only for them) therefore I deduce that the getInstanceByName is not able to locate the modules.

What could be happened? There is a specific cache for modules to be clean?

I used the 1-click plugin to understand was files had been changed. This problem was solved by replacing the "vendor" folder with a new one.

A modules upgrade maybe went wrong.

 

Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...