laravel-imageupload icon indicating copy to clipboard operation
laravel-imageupload copied to clipboard

conflict between s3_enabled = false and 'output' => env('IMAGEUPLOAD_OUTPUT', 'db')

Open rares-lupascu opened this issue 7 years ago • 5 comments

Hi

If i set s3_enabled = false and 'output' => env('IMAGEUPLOAD_OUTPUT', 'db') the system is still trying to use the s3_url ... so when uploading i get:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'home_listing_s3_url' in 'where clause'

thanks

rares-lupascu avatar May 18 '18 12:05 rares-lupascu

I second this one. Can you wrap the s3 stuff in an if statement if output is set to db?

wkopala avatar May 31 '18 20:05 wkopala

Can you give me more detil on this issue? What version of Laravel and PHP do you use?

matriphe avatar Jun 01 '18 06:06 matriphe

I am using "laravel/framework": "5.6.*" and "php": ">=7.1.3"

rares-lupascu avatar Jun 01 '18 08:06 rares-lupascu

Same for me with larvel version and php version.

There’s some code I the Imageupload.php file that assumes usage of s3, even though there isn’t anything in the migration file to add in these s3 fields that the db is then trying to save to.

wkopala avatar Jun 01 '18 12:06 wkopala

I figured out this issue a little better. In the saveOriginalFile function, it's setting an array key for dimension_s3_url, even if s3 is not being used. So that when the db function to createOrFirst is called and sent in the collection, there's an empty array key for s3 and no matching db field for it and it throws an error.

wkopala avatar Jun 01 '18 18:06 wkopala