Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Traductions files ignored when symlink #36161

Open
2 tasks done
Jeremie-Kiwik opened this issue May 14, 2024 · 4 comments · May be fixed by #36160
Open
2 tasks done

Traductions files ignored when symlink #36161

Jeremie-Kiwik opened this issue May 14, 2024 · 4 comments · May be fixed by #36160
Labels
Bug Type: Bug CO Category: Core Ready Status: Issue is ready to be worked on Trivial Severity: trivial bug > https://build.prestashop.com/news/severity-classification

Comments

@Jeremie-Kiwik
Copy link

Prerequisites

Describe the bug and add attachments

The Finder used to search traduction files does not follow symlinks by default. Which is a major problem when working with modern and robust solutions like Deployer.

On those environments, each GIT release is in a specific folder, and the "living" files (traductions, images...) are in a common shared folder. And symlinks are made to point to the shared folder.

So for now, all the traduction files are ignored by Presta, as they are symlinks.

Expected behavior

Also parse symlinked traduction files

Steps to reproduce

  • Move a traduction file somewhere else on your filesystem (mainly Linux)
  • make a symlink (for example: ln -fs /moved/file /original/place)
  • rm Prestashop cache (rm var/cache/*/translations -Rf)
  • navigate to a page
  • check the traductions are no longer visible

PrestaShop version(s) where the bug happened

1.7.8 to 9.0

PHP version(s) where the bug happened

No response

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

KIWIK (kiwik.com)

@Jeremie-Kiwik Jeremie-Kiwik added Bug Type: Bug New New issue not yet processed by QA labels May 14, 2024
@kpodemski kpodemski added Trivial Severity: trivial bug > https://build.prestashop.com/news/severity-classification Ready Status: Issue is ready to be worked on CO Category: Core and removed New New issue not yet processed by QA labels May 15, 2024
@Lathanao
Copy link
Contributor

Lathanao commented May 16, 2024

I don't know if that can help, simlink does not transfert permissions...
Btw, I nerver did a rm on only a particular item in the cache directiory like you did.
Do you have the problem if you rm on all cache file?

@Jeremie-Kiwik
Copy link
Author

Jeremie-Kiwik commented May 16, 2024

This is not related to the cache files. You can indeed rm -rf var/cache. The problem is that the new generated cache file of traductions will not have all the traductions, as the native PS code will ignore symlinks:

  • it parses app/Resources/translations for regular files,
  • it concatenates them all in a cache file,
  • and put the result in var/cache/traductions/xxx.

But in "Deployer" environment, we only have symbolic links in app/Resources/translations, pointing to a "shared" folder elsewhere. So Presta ignores them. And do not add them in the generated cache file.

@Lathanao
Copy link
Contributor

I don't know if that can help, did you tried to bind the directory?
mount --bind /some/where /else/where

@Jeremie-Kiwik
Copy link
Author

Mmh, this should work. You're right. But you also have traductions folders in every module. Which would generate a hudge number of mounts.

To my mind, patching as I did in the PR is the best approach, as it does not impact the server. It just takes care of every files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Type: Bug CO Category: Core Ready Status: Issue is ready to be worked on Trivial Severity: trivial bug > https://build.prestashop.com/news/severity-classification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants