Jump to content

Error presta 1.7


gorki75

Recommended Posts

  • 5 months later...

Hola gorki75

 

Whoops, looks like something went wrong. 1/1FatalErrorException in AdminController.php line 2708:Error: Call to a member function trans() on null

Al cargar fichero CSV de categorías con el modulo automático del proveedor.

No se que quiere decir este error, alguna solución ?

 

 

Yo lo he solucionado cambiando en el fichero AdminController.php la función

protected function l($string, $class = null, $addslashes = false, $htmlentities = true)
    {
        $translated = $this->translator->trans($string);
        if ($translated !== $string) {
            return $translated;
        }

        if ($class === null || $class == 'AdminTab') {
            $class = substr(get_class($this), 0, -10);
        } elseif (strtolower(substr($class, -10)) == 'controller') {
            /* classname has changed, from AdminXXX to AdminXXXController, so we remove 10 characters and we keep same keys */
            $class = substr($class, 0, -10);
        }
        return Translate::getAdminTranslation($string, $class, $addslashes, $htmlentities);
    }

Por

protected function l($string, $class = null, $addslashes = false, $htmlentities = true)
    {
        if ( _PS_VERSION_ >= '1.7') {
            return Context::getContext()->getTranslator()->trans($string);
        } else {
            return parent::l($string, $class, $addslashes, $htmlentities);
        }
    }

Espero que te funcione.

 

Un saludo.

Link to comment
Share on other sites

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...