You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Laravel Framework v9.43.0
Nova v4.19.5
ebess/advanced-nova-media-library v4.0.5
Issue:
When I try to upload a file on my local machine to S3 without using octane, it works, but when deployed to Vapor running with Octane, the exact same code gets this error:
/**
* This creates a Media object from a previously, client-side, uploaded file.
* The file is uploaded using a pre-signed S3 URL, via Vapor.store.
* This method will use addMediaFromUrl(), passing it the
* temporary location of the file.
*/
private function makeMediaFromVaporUpload(array $file, HasMedia $model): FileAdder
{
$diskName = config('filesystems.default');
$disk = config('filesystems.disks.' . $diskName . 'driver') === 's3' ? $diskName : 's3';
$url = Storage::disk($disk)->temporaryUrl($file['key'], Carbon::now()->addHour()); // bug is here
return $model->addMediaFromUrl($url)
->usingFilename($file['file_name']);
}
Commenting out the octane section fixes the error - but the app experience degrades.
The text was updated successfully, but these errors were encountered:
asugai
changed the title
Undefined array key "key" on Vapor with Advanced Nova Media LibraryUndefined array key "key" on Vapor due to Octane
Dec 15, 2022
Also experiencing this issue exactly as described - very similar build.
Removing octane solves it. Would be very good if we could use both simultaneously. Not sure if any maintainers have an inkling where the issue might originate or if solvable. Happy to help where I can and definitely test any solution
Laravel Framework v9.43.0
Nova v4.19.5
ebess/advanced-nova-media-library v4.0.5
Issue:
When I try to upload a file on my local machine to S3 without using octane, it works, but when deployed to Vapor running with Octane, the exact same code gets this error:
vendor/ebess/advanced-nova-media-library/src/Fields/Media.php:385 Illuminate\Foundation\Bootstrap\HandleExceptions::handleError
Undefined array key \"key\"
The file is saved correctly from the UI to the S3 tmp folder. The backend just can't seem to find the property in the $file var.
Sample payload
.env
Files field definition
vapor.yml
Commenting out the octane section fixes the error - but the app experience degrades.
The text was updated successfully, but these errors were encountered: