Jump to content

[Solved] Trouble when translating Prestashop


SzymonBl

Recommended Posts

Hello, 

in PrestaShop 8.2, PHP 8.0.30, and hummingbird theme, when I want to translate some missing words translations, in International > Translations > theme translation, I get an "undefined" error first:
image.png.1bbdb50f976bd7aab34d1cad647bcd97.png

Then I can't change page in translations tab, and when I reload page i get this error:

Fatal error: Uncaught Error: Failed opening required '/[MYSHOPNAME]/var/cache/dev/appParameters.php' (include_path='/[MYSHOPNAME]/vendor/pear/pear_exception:/[MYSHOPNAME]/vendor/pear/console_getopt:/[MYSHOPNAME]/vendor/pear/pear-core-minimal/src:/[MYSHOPNAME]/vendor/pear/archive_tar:.:') in /[MYSHOPNAME]/config/bootstrap.php:87 Stack trace: #0 /[MYSHOPNAME]/config/config.inc.php(57): require_once() #1 /[MYSHOPNAME]/admin464dtia6o5jeif87njp/index.php(40): require('...') #2 {main} thrown in /[MYSHOPNAME]/config/bootstrap.php on line 87

The line in this file is:

 

87    $config = require_once _PS_CACHE_DIR_ . 'appParameters.php';

88    array_walk($config['parameters'], function (&$param) {

89        $param = str_replace('%%', '%', $param ?? '');

    });

The only thing I found working, is setting permissions 644 on file cache/dev/appParameters.php, but they reset after I make another translation.

I also saw something about OPCache having a impact on this, but I'm not sure.

I would be very thankful if anyone had an idea on how could i solve this.
Tell me if I need to provide more info

Edited by SzymonBl
Problem solved (see edit history)
Link to comment
Share on other sites

It was on every translation. I forgot to delete post/mark it as solved, but i managed to get it running, and I just forced appParameters.php to have 644 permissions, by adding a php file inside presta install folder:

<?php

$file = '/bigvape/var/cache/dev/appParameters.php';

 

if (file_exists($file)) {

    chmod($file, 0644); // Set permissions to 644

    echo "Permissions set to 644 for appParameters.php.";

} else {

    echo "File not found: $file";

}

?>

  • Thanks 1
Link to comment
Share on other sites

  • SzymonBl changed the title to [Solved] Trouble when translating Prestashop

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