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

Catch S3 Delete Error #471

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yousefcisco
Copy link

Context We have a requirement to restrict the S3 bucket and prevent delete operations to ensure any malicious or accidental changes don't impact the production website.

Problem When GravityForms uploads PDF attachments it puts them in a tmp folder and then moves them to the final location. This coupled with the delete restriction causes an error which stops GravityForms form correctly linking the location of the uploaded PDF.

The solution is quite simple, just a try catch around the delete operation. However, I'm not sure how to raise a warning so any help with completing this would be greatly appreciated.

Copy link

@hm-linter hm-linter bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting failed (1016 errors).

(1009 notices occurred in your codebase, but were on files/lines not included in this PR.)

'Key' => $partsFrom['Key']
] + $options);
} catch (Exception $e) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a call to $this->triggerError here with the exception message? That seems like the best way to surface this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants