Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Add the ability to add existing S3 files to file field and download AWS Signed URLs.
Comment | File | Size | Author |
---|---|---|---|
#11 | ability_to_add_existing_s3_files_to_file_field_and_download_aws_signed_url-2631504-4.patch | 8.4 KB | jagadeeshramuj |
Comments
Comment #2
jagadeeshramuj CreditAttribution: jagadeeshramuj commentedComment #3
jagadeeshramuj CreditAttribution: jagadeeshramuj commentedComment #4
jagadeeshramuj CreditAttribution: jagadeeshramuj commentedadded additional field for download title
Comment #5
jagadeeshramuj CreditAttribution: jagadeeshramuj commentedComment #6
Albert Volkman CreditAttribution: Albert Volkman commentedPlease move the business logic (functions that are not hooks) to the bottom of the module file, or to their own namespaced class if you want to get fancy.
name = Amazon S3 Signed URL
S3
Should be-
Is this try/catch necessary? The base module doesn't do a similar check.
Add this class as a use statement at the top of the module file. Then change this line to read-
$s3 = S3Client::factory();
Capitalize s in "s3". Also, missing the return-
Remove this conditional, and the return above. Simply have a singule `return $buckets` at the end.
Should be-
return empty($item['amazons3_signed']['object']);
Comment #7
Albert Volkman CreditAttribution: Albert Volkman commentedComment #8
jagadeeshramuj CreditAttribution: jagadeeshramuj commentedHI Albert,
Thank you for your suggestions, i have fixed all the above issues other than issue no. 4
I am thinking having try...catch is good for error handler here, Kindly suggest me.
Comment #9
jagadeeshramuj CreditAttribution: jagadeeshramuj commentedComment #10
Albert Volkman CreditAttribution: Albert Volkman commentedI feel like #4 should be addressed within the amazons3 module's factory, or even the AWS factory itself. What does it return currently if the credentials are missing? A fatal error? For #8,
return (empty($item['amazons3_signed']['object'])) ? TRUE : FALSE;
is redundant, as empty() will already return TRUE/FALSE. That's why I had suggestedreturn empty($item['amazons3_signed']['object']);
.Comment #11
jagadeeshramuj CreditAttribution: jagadeeshramuj commentedHI Albert,
As per your suggestions i addressed #4 and #8 issues, kindly go through once and suggest me any changes required.