solved jrCore_confirm_media_file_is_local returns array

nate
@nate
10 years ago
917 posts
We updated the S3 Modules last night and now the below function returns an array. Is this how it should work? Or is the code written wrong?

$input_file = jrCore_confirm_media_file_is_local($_queue['profile_id'], basename($input_file), $_it);

updated by @nate: 04/20/15 03:23:19PM
michael
@michael
10 years ago
7,823 posts
The code doesn't look like it should return an array.

Whats in the array?

That function will fire either:
_jrCloudS3_s3_media_confirm_is_local()
OR
_jrCore_local_media_confirm_is_local()

depending on whether the server is a cloud or not.

Those functions then both look at the if the file exists or not and if it does exist returns the file.

In the case of the cloud, the checking function is:
_jrCloudS3_s3_media_read()

The only place an 'array' looks like it could creep in is when that function returns the 'Body' part of the object as the contents:
http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.S3.S3Client.html#_getObject

Looks like that should not be an array though.
brian
@brian
10 years ago
10,149 posts
I worked with Nate and the root cause here was that the 3rd argument is incorrect - it should not be an array, but instead is an optional "save as" local file path.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags