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

Unused static files disappear from server after updating new static file #14206

Open
tassu opened this Issue Dec 18, 2018 · 7 comments

Comments

Projects
None yet
5 participants
@tassu
Copy link

tassu commented Dec 18, 2018

When I upload new static chunk file and point to it in MODX unused chunk file disappears from server.

Step to reproduce

Create new static file and upload to server. Point chunk to new static file, old unused file disappears from server.

Expected behavior

Old file should stay in server.

Environment

2.7.0-PHP Version 7.0.33, linux

@jonleverrier

This comment has been minimized.

Copy link
Contributor

jonleverrier commented Dec 18, 2018

I can reproduce the issue.

Just to re-clarify the steps to reproduce:

  1. Upload 2 files. Lets say chunk_test1.tpl and chunk_test2.tpl
  2. Create a static chunk and point it towards chunk_test1.tpl then save.
  3. Now point the static chunk from chunk_test1.tpl to chunk_test2.tpl then save.

chunk_test1.tpl is missing from the file system

@Jako

This comment has been minimized.

Copy link
Collaborator

Jako commented Dec 19, 2018

Does this happen with or without enabling static_elements_automate_chunks?

@tassu

This comment has been minimized.

Copy link

tassu commented Dec 19, 2018

Setting is "no".

@tassu

This comment has been minimized.

Copy link

tassu commented Dec 19, 2018

Same happens when changing static template too.

@JoshuaLuckers

This comment has been minimized.

Copy link
Collaborator

JoshuaLuckers commented Dec 19, 2018

PR #14135 introduced this behaviour:

When removing/deleting a static element, it will remove the static file (if not used by another -element) and will also remove the parent directory automatically for you if the directory is empty.

@Jako

This comment has been minimized.

Copy link
Collaborator

Jako commented Dec 19, 2018

That behaviour should only be executed, when the automatic static workflow is enabled. So this has to be fixed. @sdrenth Could you look for this?

@sdrenth

This comment has been minimized.

Copy link
Contributor

sdrenth commented Dec 21, 2018

@Jako @tassu I've added a PR that fixes this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment