When trying to add an image style:

Fatal error: Call to a member function list_objects() on a non-object in /var/www/sites/all/modules/contrib/amazons3/AmazonS3StreamWrapper.inc on line 1124

CommentFileSizeAuthor
#5 2284347.5-bucket-undefined.patch1021 bytesdeviantintegral
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mstef’s picture

Okay, few problems.

This happens when the Bucket is not specified. It should degrade nicer than that without causing a WSOD.

Semi-related: Line 1013 is: drupal_set_message(t('Bucket name not configured.') . 'error');

That dot should be a comma.

mstef’s picture

Many examples of this:

$response = $this->getS3()->list_objects($this->bucket, array(
  'prefix' => $path . '/',
  'max-keys' => 1,
));

There needs to be check that getS3() returns a usable object. That function can return NULL (which is what is happening in this case).

pal4life’s picture

This happened to me when trying to run a feed importer.

deviantintegral’s picture

Assigned: Unassigned » deviantintegral

We should throw exceptions if a method like getS3() can't return a usable object. I'm going to come back and check this after #2176589: AWS PHP SDK v2 support.

deviantintegral’s picture

Version: 7.x-1.0 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
1021 bytes

I'm going to say this is wontfix for the 1.x branch given that the Drupal variable is required in the form.

deviantintegral’s picture

Status: Needs review » Closed (duplicate)

Actually, I've fixed this in a simpler way over at #2470127: Use doctrine/cache for request caching, so this will be fixed when that goes in.