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

Fix some files not being deleted #652

Merged
merged 2 commits into from Nov 23, 2023

Conversation

Hlavtox
Copy link
Contributor

@Hlavtox Hlavtox commented Nov 16, 2023

Questions Answers
Description? Solves a problem of some files not being deleted during upgrade. The common culprit was that these files had /admin in their paths.
Type? bug fix
BC breaks? no
Deprecations? no
Fixed ticket? Fixes PrestaShop/PrestaShop#34385 (partially, don't close)
Sponsor company
How to test? Upgrade from 1.7.6.9 to 8.1.2 and check that these files from the issue are gone.

How I fixed it

  • During my findings like in Fix missing files from folders containing install #651, I got to the step where it builds a list of files to get removed. It builds this list by comparing current version XML to a XML of the target version.
  • Files that are on that list, are scheduled for deletion.
  • However, I found out that because these files had universal /admin path in them, it was replacing it by our own admin folder. $list_files_diff[$k] = str_replace('/' . 'admin', '/' . $admin_dir, $path);
  • However, it was replacing it not only in the beginning, but also in the middle of the paths, resulting in paths of some files to be changed to nonsense.

Before

Snímek obrazovky 2023-11-16 192833

After

after

@Hlavtox Hlavtox added this to the 4.16.5 milestone Nov 16, 2023
@AureRita AureRita self-assigned this Nov 23, 2023
@AureRita
Copy link

Hi @Hlavtox

Thank you for your PR, I tested it and it seems to works as you can see :

Untitled_.Nov.23.2023.5_44.PM.webm

But currently we can see that we can't go on the BO, we can go in FO.

When we want to go again in BO to enable debug mode or anything else, we've this error :
image

Thank you

@Hlavtox
Copy link
Contributor Author

Hlavtox commented Nov 23, 2023

@AureRita As discussed privately, caused by not filling a session table, fixed here - #655

A workaround is to clear cookies. :-) This will create a new session and the user will be able to log in. This PR is not the problem.

@Hlavtox Hlavtox merged commit b8501a5 into PrestaShop:dev Nov 23, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
6 participants