Filament Upgrade from V2 to V3
Hi There, does anyone know how to fix this issue in regards to form state path, I've followed the updating procedure and step by step check the resources and widgets - But I can't seem to fix this issue.
50 Replies
Your functions are protected but they should be public
Hi there, all of them are public like this:
The error is on the vendor
Try deleting the vendor folder and composer install again as looking at the paths etc they don't make sense with what you are saying
I've done this multiple times with deleting and doing composer install again.
Actually I don't get it as well, since the error was pertaining to the getFormStatePath under vendor\filament\forms\src\Concerns\InteractsWithForms.php:396
Exactly my point which is why I thought forms was out of date. Can you update Filament
I've updated it as well, since I'm updating the app from V2 to V3.
run:
php artisan about
it will tell you the exact installed version
I can't run it, the error keeps persisting. I'll try doing the manual update again and get back to you, if it is still the same. Thank you.
Hi there @toeknee
I've tried it again from 0, it still returns to this error
Do your have any plugins installed?
Can you show the whole stack trace from the error.
[2023-10-27 01:23:59] local.ERROR: Access level to Filament\Forms\Concerns\InteractsWithForms::getFormStatePath() must be public (as in class Filament\Resources\Pages\ViewRecord) {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Access level to Filament\Forms\Concerns\InteractsWithForms::getFormStatePath() must be public (as in class Filament\Resources\Pages\ViewRecord) at C:\laragon\www\pm-t\vendor\filament\forms\src\Concerns\InteractsWithForms.php:396)
[stacktrace]
#0 {main}
"}
Hi There @Hugh Messenger Here's the Stack Trace
HI @awcodes For Plugins here's everything that is installed
Do:
composer show filament/filmanent
To check the installed filament versionWierd it's saying its not installed, but when I check the vendor>bin
Filament v3 is there already
I can't do artisan commands as well due to this error.
There is a typo. Try
composer show filament/filament
it seems it says here that it's on 2 still but on the vendor and composer json it's already 3
Run composer update
Sorry this was from a separate App lol. Here's the output from this App.
Everything seems to be fine.
But I still have this issue.
Remove the bootstrap cache and try again
What happens when you visit the app after the error? Do you get a more detailed stack trace
Unfortunately there's no more detailed Stack Trace - In regards to the App - I haven't gone through it yet due to the error
Hi I'm facing the same issue when upgrading the existing application from Filament V2 to V3
Can you check the filament base classes in the paths in the error for the viewrecord and the concern? Are they both public?
You will need to delv into the vendor
No it's on the Vendor from the filament/filament it's set to protected
Might be needed to update to public?
Do you have any plugins?
ahhh I have just seen, it's deprecated
Here's everything that we're using from v2
now upgraded to v3
Yeah, but we're usign the latest Filament version
You need to drop those functions from your form if I recall correctly so: form()->statePath() if memory serves and don't use the setStatePath function
We've added this already now, we're using it like this in all of our forms
Still has the same error unfortunately
That's right, I believe you need to remove it from your pages/forms. because of the inheritence it could be not showing the file that's overriding / setting and just the calling function
So look for where the statePath is set within your ViewRecord Pages
I've removed everything regarding statePath now but still results the same
try removing /vendor
and reinstalling
He has
I've just done it now, unfortunately still the same this is with a fresh re-install
are you using
InteractsWithForms
anywhere in your codebase
make sure you are not using it on any Filament pages, they already have itAhh of course, because we changed it in V3
Ohh Okay, let me try it just a sec.
Thanks
It worked, that errors gone. Thank you
Just to confirm is it similar to this error?
Since I'm using HasForms as well
Hi There, it';s working now, Since it's for Livewire components and uses forms - I believe that the interactWithForms is applicable here.
I've added it here as well but only to livewire components it works great now
Thank you!
I'll be continuing with the upgrade to the code-base as well now.
yeah
so when its a page you dont need it because the base Page class already has InteractsWithForms
but when its your own LW component, you need it
Got it, Thanks so much @Dan Harrin