Jump to content

Error al intentar traducir en PrestaShop 8


Recommended Posts

Buenas tardes gente, acabo de toparme con un error que no se si es algún tipo de bug de la nueva versión de PrestaShop (8.0.1). Al intentar actualizar las traducciones de mi tema (es la primera vez que me meto ya que es una nueva instalación), se queda cargando infinitamente y sale una alerta arriba a la derecha que pone "undefined" (adjunto captura). ¿Sabéis de que puede ser? Los valores del servidor (max_execution_time, memory_limit, max_input_vars... etc) también están aumentados por si acaso pero nada. 

error-prestashop.png

Edited by sergiorx8 (see edit history)
Link to comment
Share on other sites

Justo estaba mirando eso ahora, lo pongo a continuación:

{
  "type": "https:\/\/tools.ietf.org\/html\/rfc2616#section-10",
  "title": "An error occurred",
  "status": 500,
  "detail": "md5(): Argument #1 ($string) must be of type string, int given",
  "class": "TypeError",
  "trace": [{
    "namespace": "",
    "short_class": "",
    "class": "",
    "type": "",
    "function": "",
    "file": "\/home\/nombredetienda\/www\/src\/Core\/Translation\/Storage\/Provider\/ModuleCatalogueLayersProvider.php",
    "line": 306,
    "args": []
  }, {
    "namespace": "",
    "short_class": "",
    "class": "",
    "type": "",
    "function": "md5",
    "file": "\/home\/nombredetienda\/www\/src\/Core\/Translation\/Storage\/Provider\/ModuleCatalogueLayersProvider.php",
    "line": 306,
    "args": [
      ["integer", 4]
    ]
  }, {
    "namespace": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider",
    "short_class": "ModuleCatalogueLayersProvider",
    "class": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider\\ModuleCatalogueLayersProvider",
    "type": "->",
    "function": "buildTranslationCatalogueFromLegacyFiles",
    "file": "\/home\/nombredetienda\/www\/src\/Core\/Translation\/Storage\/Provider\/ModuleCatalogueLayersProvider.php",
    "line": 195,
    "args": [
      ["string", "es-ES"]
    ]
  }, {
    "namespace": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider",
    "short_class": "ModuleCatalogueLayersProvider",
    "class": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider\\ModuleCatalogueLayersProvider",
    "type": "->",
    "function": "getFileTranslatedCatalogue",
    "file": "\/home\/nombredetienda\/www\/src\/Core\/Translation\/Storage\/Provider\/ThemeCatalogueLayersProvider.php",
    "line": 256,
    "args": [
      ["string", "es-ES"]
    ]
  }, {
    "namespace": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider",
    "short_class": "ThemeCatalogueLayersProvider",
    "class": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider\\ThemeCatalogueLayersProvider",
    "type": "->",
    "function": "getModulesTranslations",
    "file": "\/home\/nombredetienda\/www\/src\/Core\/Translation\/Storage\/Provider\/ThemeCatalogueLayersProvider.php",
    "line": 166,
    "args": [
      ["string", "es-ES"]
    ]
  }, {
    "namespace": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider",
    "short_class": "ThemeCatalogueLayersProvider",
    "class": "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider\\ThemeCatalogueLayersProvider",
    "type": "->",
    "function": "getFileTranslatedCatalogue",
    "file": "\/home\/nombredetienda\/www\/src\/Core\/Translation\/Builder\/TranslationCatalogueBuilder.php",
    "line": 183,
    "args": [
      ["string", "es-ES"]
    ]
  }, {
    "namespace": "PrestaShop\\PrestaShop\\Core\\Translation\\Builder",
    "short_class": "TranslationCatalogueBuilder",
    "class": "PrestaShop\\PrestaShop\\Core\\Translation\\Builder\\TranslationCatalogueBuilder",
    "type": "->",
    "function": "getRawCatalogue",
    "file": "\/home\/nombredetienda\/www\/src\/Core\/Translation\/Builder\/TranslationsTreeBuilder.php",
    "line": 81,
    "args": [
      ["object", "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider\\Definition\\ThemeProviderDefinition"],
      ["string", "es-ES"],
      ["array", []]
    ]
  }, {
    "namespace": "PrestaShop\\PrestaShop\\Core\\Translation\\Builder",
    "short_class": "TranslationsTreeBuilder",
    "class": "PrestaShop\\PrestaShop\\Core\\Translation\\Builder\\TranslationsTreeBuilder",
    "type": "->",
    "function": "getTree",
    "file": "\/home\/nombredetienda\/www\/src\/PrestaShopBundle\/Service\/TranslationService.php",
    "line": 166,
    "args": [
      ["object", "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider\\Definition\\ThemeProviderDefinition"],
      ["string", "es-ES"],
      ["array", []]
    ]
  }, {
    "namespace": "PrestaShopBundle\\Service",
    "short_class": "TranslationService",
    "class": "PrestaShopBundle\\Service\\TranslationService",
    "type": "->",
    "function": "getTranslationsTree",
    "file": "\/home\/nombredetienda\/www\/src\/PrestaShopBundle\/Controller\/Api\/TranslationController.php",
    "line": 381,
    "args": [
      ["object", "PrestaShop\\PrestaShop\\Core\\Translation\\Storage\\Provider\\Definition\\ThemeProviderDefinition"],
      ["string", "es-ES"],
      ["array", []]
    ]
  }, {
    "namespace": "PrestaShopBundle\\Controller\\Api",
    "short_class": "TranslationController",
    "class": "PrestaShopBundle\\Controller\\Api\\TranslationController",
    "type": "->",
    "function": "getTree",
    "file": "\/home\/nombredetienda\/www\/src\/PrestaShopBundle\/Controller\/Api\/TranslationController.php",
    "line": 164,
    "args": [
      ["string", "es"],
      ["string", "themes"],
      ["array", []],
      ["string", "warehouse"]
    ]
  }, {
    "namespace": "PrestaShopBundle\\Controller\\Api",
    "short_class": "TranslationController",
    "class": "PrestaShopBundle\\Controller\\Api\\TranslationController",
    "type": "->",
    "function": "listTreeAction",
    "file": "\/home\/nombredetienda\/www\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php",
    "line": 169,
    "args": [
      ["object", "Symfony\\Component\\HttpFoundation\\Request"]
    ]
  }, {
    "namespace": "Symfony\\Component\\HttpKernel",
    "short_class": "HttpKernel",
    "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
    "type": "->",
    "function": "handleRaw",
    "file": "\/home\/nombredetienda\/www\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/HttpKernel.php",
    "line": 81,
    "args": [
      ["object", "Symfony\\Component\\HttpFoundation\\Request"],
      ["integer", 1]
    ]
  }, {
    "namespace": "Symfony\\Component\\HttpKernel",
    "short_class": "HttpKernel",
    "class": "Symfony\\Component\\HttpKernel\\HttpKernel",
    "type": "->",
    "function": "handle",
    "file": "\/home\/nombredetienda\/www\/vendor\/symfony\/symfony\/src\/Symfony\/Component\/HttpKernel\/Kernel.php",
    "line": 201,
    "args": [
      ["object", "Symfony\\Component\\HttpFoundation\\Request"],
      ["integer", 1],
      ["boolean", false]
    ]
  }, {
    "namespace": "Symfony\\Component\\HttpKernel",
    "short_class": "Kernel",
    "class": "Symfony\\Component\\HttpKernel\\Kernel",
    "type": "->",
    "function": "handle",
    "file": "\/home\/nombredetienda\/www\/micarpetadeadmin\/index.php",
    "line": 81,
    "args": [
      ["object", "Symfony\\Component\\HttpFoundation\\Request"],
      ["integer", 1],
      ["boolean", false]
    ]
  }]
}

 

Link to comment
Share on other sites

Edita el fichero /src/Core/Translation/Storage/Provider/ModuleCatalogueLayersProvider.php.

Busca la línea 306, deberías tener esto:

$legacyKey = md5($translationKey);

Pon antes:

if (is_int($translationKey)) {
	dump($currentDomain);
	dump($translationKey);
	die;
}

Y a ver qué devuelve la petición ahora.

Edited by idnovate.com (see edit history)
  • Like 1
Link to comment
Share on other sites

Obtengo lo siguiente (he tenido que borrar el codigo js y css porque me bloqueaba cloudflare): 

<span class=sf-dump-str title="31 characters">ModulesIqitmegamenuIqitmegamenu</span>
<pre class=sf-dump id=sf-dump-764014833 data-indent-pad="  "><a href="http://dominiomitienda.com/carpetaadmin/index.php/_profiler/open?_token=exvjNBIXpC2lBrjzZZsm749mhR-hnEkmqiuM6FuODJQ?file=src/Core/Translation/Storage/Provider/ModuleCatalogueLayersProvider.php&amp;line=309#line309" title="/home/nombremitienda/www/src/Core/Translation/Storage/Provider/ModuleCatalogueLayersProvider.php"><span class=sf-dump-meta>ModuleCatalogueLayersProvider.php</span></a> on line <span class=sf-dump-meta>309</span>:
<span class=sf-dump-num>4</span>

 

Edited by sergiorx8 (see edit history)
Link to comment
Share on other sites

Muchas gracias idnovate.com, ahora te hablo por privado. Desde el hosting hable con el soporte técnico a ver si veían algo en el log y decían que vieron este error, pero no se si tendrá que ver:

[Wed Feb 15 14:44:46.558666 2023] [proxy_fcgi:error] [pid 13082:tid 140201078810368] [client 79.116.134.226:42928] AH01071: Got error 'PHP message: PHP Fatal error:  Uncaught SmartyException: Unable to load template 'module:ps_languageselector/ps_languageselector-mobile-menu.tpl' in 'module:iqitmegamenu/views/templates/hook/mobile.tpl' in /home/nombremitienda/www/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php:195\nStack trace:\n#0 /home/nombremitienda/www/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(385): Smarty_Internal_Template->render()\n#1 /home/nombremitienda/www/var/cache/dev/smarty/compile/warehouse_child/98/cb/9e/98cb9e3fbf4c879e219db3109049550b02a2da1b_2.module.iqitmegamenuviewstemplate.php(229): Smarty_Internal_Template->_subTemplateRender('module:ps_langu...', 'iqitmegamenu|in...', 'warehouse-child', 0, 3600, Array, 0, false)\n#2 /home/nombremitienda/www/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_63ecaf85053eb4_66689497(Object(SmartyDevTemplate))\n#3 /home/nombremitienda/www/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base-...', referer: http://nombremitienda.com/micarpetaadmin/index.php/improve/international/translations/?lang=es&type=themes&locale=es-ES&selected=warehouse&_token=exvjNBIXpC2lBrjzZZsm749mhR-hnEkmqiuM6FuODJQ

 

  • Like 1
Link to comment
Share on other sites

18 hours ago, idnovate.com said:

Modifica el fichero /src/Core/Translation/Storage/Provider/ModuleCatalogueLayersProvider.php.

Busca la línea 306, deberías tener esto:

$legacyKey = md5($translationKey);

Pon antes:

if (is_int($translationKey)) {
    continue;
}

 

Muchas gracias idnovate.com, todo solucionado ya con la modificación que has puesto 😁

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

Hi.

I have the same problem:(

I  add 

if (is_int($translationKey)) { continue; } 

before

$legacyKey = md5($translationKey);

but message undefined is still there.

 

You only add this commands to /src/Core/Translation/Storage/Provider/ModuleCatalogueLayersProvider.php? 

 

 

Link to comment
Share on other sites

On 7/21/2023 at 4:03 PM, Olena123 said:

Hi.

I have the same problem:(

I  add 

if (is_int($translationKey)) { continue; } 

before

$legacyKey = md5($translationKey);

but message undefined is still there.

 

You only add this commands to /src/Core/Translation/Storage/Provider/ModuleCatalogueLayersProvider.php? 

 

 

¿Cuál es tu error exactamente?

Link to comment
Share on other sites

  • 4 months later...
  • 7 months later...

Hi,

I have the same problem. I added:

if (!is_string($translationKey)) continue;
or

if (is_int($translationKey)) { continue; }

but I still get the "undefined" message on top.


image.thumb.png.82813104bddb423fd31bfa35e4b314aa.png
Any with the same problem?

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