dcasia / nova-filepond

A Nova field for uploading File, Image and Video using Filepond.
MIT License
49 stars 28 forks source link

Unable to update a resource without changing image in filepond #4

Closed Crazymodder closed 5 years ago

Crazymodder commented 5 years ago

Hi,

If I want to update a resource where I already have attached an image with filepond I get an error that the file xxxx.jpeg does not exists. Maybe the path from disk parameter is not resolved correctly.

Here is the Nova Part:

Filepond::make(__('product.image.title'), 'image') ->help(__('product.image.help')) ->mimesTypes(['image/jpeg', 'image/gif', 'image/png']) ->disk('public', '/') ->storeAs(function (File $file) { return Str::random(13) . '.' . $file->getExtension(); }),

Here is the log:

{ "message": "The file \"6xANBIZm8sgKG.jpeg\" does not exist", "exception": "Symfony\\Component\\HttpFoundation\\File\\Exception\\FileNotFoundException", "file": "/var/www/project/vendor/symfony/http-foundation/File/File.php", "line": 36, "trace": [ { "file": "/var/www/project/vendor/digital-creative/nova-filepond/src/Filepond.php", "line": 214, "function": "__construct", "class": "Symfony\\Component\\HttpFoundation\\File\\File", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Fields/Field.php", "line": 338, "function": "fillAttributeFromRequest", "class": "DigitalCreative\\Filepond\\Filepond", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Fields/Field.php", "line": 317, "function": "fillAttribute", "class": "Laravel\\Nova\\Fields\\Field", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Fields/Field.php", "line": 291, "function": "fillInto", "class": "Laravel\\Nova\\Fields\\Field", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Support/HigherOrderCollectionProxy.php", "line": 60, "function": "fill", "class": "Laravel\\Nova\\Fields\\Field", "type": "->" }, { "function": "Illuminate\\Support\\{closure}", "class": "Illuminate\\Support\\HigherOrderCollectionProxy", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Support/Collection.php", "line": 1120, "function": "array_map" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Support/HigherOrderCollectionProxy.php", "line": 61, "function": "map", "class": "Illuminate\\Support\\Collection", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/FillsFields.php", "line": 67, "function": "__call", "class": "Illuminate\\Support\\HigherOrderCollectionProxy", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/FillsFields.php", "line": 35, "function": "fillFields", "class": "Laravel\\Nova\\Resource", "type": "::" }, { "file": "/var/www/project/vendor/laravel/nova/src/Http/Controllers/ResourceUpdateController.php", "line": 32, "function": "fillForUpdate", "class": "Laravel\\Nova\\Resource", "type": "::" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php", "line": 29, "function": "Laravel\\Nova\\Http\\Controllers\\{closure}", "class": "Laravel\\Nova\\Http\\Controllers\\ResourceUpdateController", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php", "line": 349, "function": "transaction", "class": "Illuminate\\Database\\Connection", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php", "line": 239, "function": "__call", "class": "Illuminate\\Database\\DatabaseManager", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Http/Controllers/ResourceUpdateController.php", "line": 41, "function": "__callStatic", "class": "Illuminate\\Support\\Facades\\Facade", "type": "::" }, { "function": "handle", "class": "Laravel\\Nova\\Http\\Controllers\\ResourceUpdateController", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Controller.php", "line": 54, "function": "call_user_func_array" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php", "line": 45, "function": "callAction", "class": "Illuminate\\Routing\\Controller", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 219, "function": "dispatch", "class": "Illuminate\\Routing\\ControllerDispatcher", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Route.php", "line": 176, "function": "runController", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 680, "function": "run", "class": "Illuminate\\Routing\\Route", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 30, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Http/Middleware/Authorize.php", "line": 18, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\Authorize", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Http/Middleware/BootTools.php", "line": 20, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\BootTools", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Http/Middleware/DispatchServingNovaEvent.php", "line": 20, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\DispatchServingNovaEvent", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php", "line": 43, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Http/Middleware/Authenticate.php", "line": 31, "function": "handle", "class": "Illuminate\\Auth\\Middleware\\Authenticate", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\Authenticate", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php", "line": 41, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php", "line": 75, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php", "line": 49, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php", "line": 56, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Session\\Middleware\\StartSession", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php", "line": 37, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php", "line": 66, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Cookie\\Middleware\\EncryptCookies", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 104, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 682, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 657, "function": "runRouteWithinStack", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 623, "function": "runRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Router.php", "line": 612, "function": "dispatchToRoute", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 176, "function": "dispatch", "class": "Illuminate\\Routing\\Router", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 30, "function": "Illuminate\\Foundation\\Http\\{closure}", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/project/vendor/laravel/nova/src/Http/Middleware/ServeNova.php", "line": 26, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Laravel\\Nova\\Http\\Middleware\\ServeNova", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/fideloper/proxy/src/TrustProxies.php", "line": 57, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Fideloper\\Proxy\\TrustProxies", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 21, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php", "line": 21, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php", "line": 27, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php", "line": 62, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 163, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", "line": 53, "function": "Illuminate\\Pipeline\\{closure}", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", "line": 104, "function": "Illuminate\\Routing\\{closure}", "class": "Illuminate\\Routing\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 151, "function": "then", "class": "Illuminate\\Pipeline\\Pipeline", "type": "->" }, { "file": "/var/www/project/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", "line": 116, "function": "sendRequestThroughRouter", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" }, { "file": "/var/www/project/public/index.php", "line": 55, "function": "handle", "class": "Illuminate\\Foundation\\Http\\Kernel", "type": "->" } ] }

milewski commented 5 years ago

@Crazymodder fixed on version v0.2.4