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

Multi-file, private file fields can't delete directory properly #2814

Closed
Shelob9 opened this issue Nov 19, 2018 · 2 comments
Closed

Multi-file, private file fields can't delete directory properly #2814

Shelob9 opened this issue Nov 19, 2018 · 2 comments
Assignees
Labels
Bug Has PR Bug/Feature with a PR created for it.
Milestone

Comments

@Shelob9
Copy link
Collaborator

Shelob9 commented Nov 19, 2018

To reproduce:

  • add form with a file field with attaching to mailer checked by not add to media library and a submit button.
  • Load form in front-end.
  • Add two file fields to the field
  • Submit form.
  • In error log see an error like

I think that the issue is Caldera_Forms_Files is creating the hash based on field ID and form ID, so both files go to same directory, then when deleting first one, can't delete the directory since second one is in it.

Related to #2766 but is pre-existing issue. I am going to think about how to improve cleanup and fix tomorrow.

@Shelob9 Shelob9 added the Bug label Nov 19, 2018
@Shelob9 Shelob9 self-assigned this Nov 19, 2018
@Shelob9 Shelob9 added this to the 1.8.0 milestone Nov 19, 2018
@Shelob9 Shelob9 changed the title Multi-file, private file fields can't delete directory properlu Multi-file, private file fields can't delete directory properly Nov 20, 2018
@Shelob9
Copy link
Collaborator Author

Shelob9 commented Nov 20, 2018

  • Forming the secret_dir URL with process_id will avoid this and possibly other bugs related to files.
  • classes/files.php L48 should get replaced with new job to delete file

Shelob9 pushed a commit that referenced this issue Nov 21, 2018
Shelob9 pushed a commit that referenced this issue Nov 21, 2018
Shelob9 pushed a commit that referenced this issue Nov 21, 2018
Shelob9 pushed a commit that referenced this issue Nov 21, 2018
Shelob9 pushed a commit that referenced this issue Nov 21, 2018
@Shelob9 Shelob9 added the Has PR Bug/Feature with a PR created for it. label Nov 21, 2018
Shelob9 pushed a commit that referenced this issue Nov 22, 2018
* feature/2814:
  #2814 schedule deletes in cf2 fiel fields and cleanup that handler a bit
  #2814 schedule deletes
  #2814 handle deleting directory if empty
  Only try to delete file, if it exists #2814
  Test to prove that the delete file job will make an uncaught exception in some cases #2814
  Make new job for deleting tests work #2814
  New job for deleting files #2814 - failing tests
  Make new utility methods needed for #2814 and #2794 work
  Failing tests for utility methods needed for #2814  and #2794
  #2814 rm dead code and add inline docs to existing delete job
@New0
Copy link
Collaborator

New0 commented Dec 7, 2018

Fixed by #2819

@New0 New0 closed this as completed Dec 7, 2018
Shelob9 pushed a commit that referenced this issue Dec 14, 2018
* develop:
  During form submission, start buffer, then flush it. #2820 and #2448 and #2788
  Set window.cf2 if not an object #2821
  #2814 schedule deletes in cf2 fiel fields and cleanup that handler a bit
  #2814 schedule deletes
  #2814 handle deleting directory if empty
  Only try to delete file, if it exists #2814
  Test to prove that the delete file job will make an uncaught exception in some cases #2814
  Make new job for deleting tests work #2814
  New job for deleting files #2814 - failing tests
  Make new utility methods needed for #2814 and #2794 work
  Failing tests for utility methods needed for #2814  and #2794
  #2814 rm dead code and add inline docs to existing delete job

# Conflicts:
#	cf2/functions.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Has PR Bug/Feature with a PR created for it.
Projects
None yet
Development

No branches or pull requests

2 participants