outl1ne / nova-settings

A Laravel Nova tool for editing custom settings using native Nova fields.
MIT License
278 stars 97 forks source link

Settings not saving. Call to undefined method stdClass::forceFill() #166

Closed Blindmikey closed 1 year ago

Blindmikey commented 1 year ago

Settings page was working well, but during development something happened and now when attempting to save any setting I get the error: Call to undefined method stdClass::forceFill()

Any insight at all would be immensely helpful.

Stack trace:

[2023-06-28 00:15:31] local.ERROR: Call to undefined method stdClass::forceFill() {"userId":1,"exception":"[object] (Error(code: 0): Call to undefined method stdClass::forceFill() at /home/vagrant/code/vendor/laravel/nova/src/Fields/Field.php:492)
[stacktrace]
#0 /home/vagrant/code/vendor/laravel/nova/src/Fields/Field.php(475): Laravel\\Nova\\Fields\\Field->fillModelWithData()
#1 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Support/helpers.php(307): Laravel\\Nova\\Fields\\Field->Laravel\\Nova\\Fields\\{closure}()
#2 /home/vagrant/code/vendor/laravel/nova/src/Fields/Field.php(472): tap()
#3 /home/vagrant/code/vendor/laravel/nova/src/Fields/Field.php(457): Laravel\\Nova\\Fields\\Field->fillAttributeFromRequest()
#4 /home/vagrant/code/vendor/laravel/nova/src/Fields/Field.php(439): Laravel\\Nova\\Fields\\Field->fillAttribute()
#5 /home/vagrant/code/vendor/laravel/nova/src/Fields/Field.php(413): Laravel\\Nova\\Fields\\Field->fillInto()
#6 /home/vagrant/code/vendor/outl1ne/nova-settings/src/Http/Controllers/SettingsController.php(90): Laravel\\Nova\\Fields\\Field->fill()
#7 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(236): Outl1ne\\NovaSettings\\Http\\Controllers\\SettingsController->Outl1ne\\NovaSettings\\Http\\Controllers\\{closure}()
#8 /home/vagrant/code/vendor/outl1ne/nova-settings/src/Http/Controllers/SettingsController.php(79): Illuminate\\Support\\Collection->each()
#9 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Outl1ne\\NovaSettings\\Http\\Controllers\\SettingsController->save()
#10 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#11 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#12 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#13 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Routing\\Route->run()
#14 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#15 /home/vagrant/code/vendor/outl1ne/nova-settings/src/Http/Middleware/SettingsPathExists.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#16 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Outl1ne\\NovaSettings\\Http\\Middleware\\SettingsPathExists->handle()
#17 /home/vagrant/code/vendor/outl1ne/nova-settings/src/Http/Middleware/Authorize.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Outl1ne\\NovaSettings\\Http\\Middleware\\Authorize->handle()
#19 /home/vagrant/code/vendor/whitecube/nova-flexible-content/src/Http/Middleware/InterceptFlexibleAttributes.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Whitecube\\NovaFlexibleContent\\Http\\Middleware\\InterceptFlexibleAttributes->handle()
#21 /home/vagrant/code/vendor/laravel/nova/src/Http/Middleware/BootTools.php(20): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Laravel\\Nova\\Http\\Middleware\\BootTools->handle()
#23 /home/vagrant/code/vendor/laravel/nova/src/Http/Middleware/DispatchServingNovaEvent.php(33): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Laravel\\Nova\\Http\\Middleware\\DispatchServingNovaEvent->handle()
#25 /home/vagrant/code/vendor/inertiajs/inertia-laravel/src/Middleware.php(87): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Inertia\\Middleware->handle()
#27 /home/vagrant/code/app/Http/Middleware/BadLoginAttempts.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\BadLoginAttempts->handle()
#29 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#30 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#31 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#33 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#35 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#37 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#38 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#39 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#40 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#41 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#42 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Pipeline\\Pipeline->then()
#44 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(777): Illuminate\\Routing\\Router->runRouteWithinStack()
#45 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(741): Illuminate\\Routing\\Router->runRoute()
#46 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Routing/Router.php(730): Illuminate\\Routing\\Router->dispatchToRoute()
#47 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#48 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#49 /home/vagrant/code/vendor/laravel/nova/src/Http/Middleware/ServeNova.php(23): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Laravel\\Nova\\Http\\Middleware\\ServeNova->handle()
#51 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#52 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#53 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#54 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#55 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#56 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#57 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#58 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#59 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#60 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#61 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#62 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#63 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#64 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#65 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#66 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#67 /home/vagrant/code/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#68 /home/vagrant/code/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle()
#69 {main}
"} 
Blindmikey commented 1 year ago

Attempted a clean install doing the following:

composer clear-cache
composer create-project laravel/laravel ./
(edit .env file to correct database settings)
php artisan db:wipe
composer config repositories.nova '{"type": "composer", "url": "https://nova.laravel.com"}' --file composer.json
(edited composer.json to include "laravel/nova": "^4.0" in "require")
composer update --prefer-dist
php artisan nova:install
php artisan nova:user
(logged in, confirmed nova is working)
composer require outl1ne/nova-settings
php artisan migrate
(updated app/Providers/NovaServiceProvider.php as per docs in this repo)
(reloaded nova in browser, see new settings menu - navigate to it)
(edit both the example setting fields "Some setting" and "A number" - clicked "Save settings" button)

Got the error above.

Blindmikey commented 1 year ago

Found the issue - Laravel Nova 4.26.0 (released today) introduces the error. Rolling back to 4.25.1 (one release prior) resolves the issue.