First off, great work on this module as it fulfills a major need on my site.
I am getting a PHP warning when I enabled the module. It appears that the amazons3_cors_libraries_info_alter() on line 56 is not properly loading the s3browserupload extension which is breaking the functionality.
Notice: Undefined variable: path in libraries_load_files() (line 707 of /srv/bindings/c6c8ed3749d84d79902c6b854f7b09a3/code/sites/all/modules/libraries/libraries.module).
I was unable to get it to work through this hook and ended up having to disable it and call require_once at the bottom of the sdk.class file within the AWSSDK library.
I am using the most recent Dev versions of Libraries and the AWS module as well as version 1.6.1 of the AWSSDK for PHP.
Comments
Comment #1
dougvann commentedI tried to follow Albert's solution:
I must have done something wrong.
1. comment out the offending line # 59 of amazons3_cors.module [this hook now does nothing at all]
2. edit sdk.class.php and add
require_once('extensions/s3browserupload.class.php');
to the very very end [outside of the conditional block, although i tried it just barely inside as well]
3. drush cc all
Go to upload a 32M file and it looks good, but gets to the end and hangs. The bar shows 100% but it never truly completes.
If I check watchdog I see
Notice: Undefined index: form_build_id in ajax_get_form() (line 320 of /home/clients/websites/w_upload/public_html/upload/includes/ajax.inc).
Followed by:
Invalid form POST data.
Oddly though... If I try a much smaller file [below the server limit] It does upload straight to AS# and I get this error:
Warning: filesize(): stat failed for s3:///backup-1.sql in file_save() (line 566 of /home/clients/websites/w_upload/public_html/upload/includes/file.inc).
I'm at a loss at this point.
I am also using the most recent Dev versions of Libraries and the AWS module as well as version 1.6.1 of the AWSSDK for PHP.
Comment #2
hbk commentedSame problem
Comment #3
balashine commentedI Have installed ,
Amazon s3 module and the related modules,
When i upload the image or when i load the site , I am getting this warning error message,
Notice: Undefined variable: path in libraries_load_files() (line 707 of /opt/lampp/htdocs/drupal/sites/all/modules/libraries/libraries.module).
Can any one suggest me how to fix this issue ?
Thank you
Comment #4
balashine commentedGive the libraries whole path /sites/all/libraries/awssdk/extension/
in the Amazon3crons.module file that warning error must resolved
With Regards
bala
Comment #5
dougvann commentedHmmmm.
Not sure what's going on here.
Blashine, could you provide some line numbers and/or code snippets?
For now... I'm running away from this solution and starting fresh. I'm researching how this works without regard to the Drupal aspect then I'll be heading for a total custom solution. It's not clear to me where the failure is with these two modules; is it with libraries or amazons3_cors?
I'll post back with my progress, either way...
Comment #6
CaptainHook-1 commentedI encountered this issue the moment I started to test and looked into it for a couple of minutes. Looks like the problem is actually with Libraries and Version 1.0 of the AWS SDK for PHP. (And echoing OP, thank you very much for this handy module.)
In sdk.class.php, the penultimate line 1516 runs in the global scope outside of the CFLoader class context and unsets $path.
Libraries loads it first and loses its local $path variable, which is needed for the require_once on the line # that is throwing a Notice.
Looks like 1.5.15 is the tag where this was introduced. However, rolling back to 1.5.14 causes CORS errors in Chrome, which makes it basically unusable for me. If you don't need Webkit support, maybe that will work for you, but I haven't tested.
I would say the "solution" is to not use the $path variable in Libraries, which is unfortunate but necessary. I will get a patch up on Libraries in a second and reference it here.
UPDATE: made a low-priority ticket in the issue queue on Libraries: https://drupal.org/node/2015731.
The patch there fixes this issue.
Comment #7
Ignigena commentedCaptainHook, awesome job tracing down the issue. I'll test your patch as soon as I'm able! Glad for a non-hacky fix for this issue!