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.
No description
50 Replies
toeknee
toeknee13mo ago
Your functions are protected but they should be public
Mike Wazowski
Mike WazowskiOP13mo ago
Hi there, all of them are public like this: The error is on the vendor
No description
toeknee
toeknee13mo ago
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
Mike Wazowski
Mike WazowskiOP13mo ago
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
toeknee
toeknee13mo ago
Exactly my point which is why I thought forms was out of date. Can you update Filament
Mike Wazowski
Mike WazowskiOP13mo ago
I've updated it as well, since I'm updating the app from V2 to V3.
No description
toeknee
toeknee13mo ago
run: php artisan about it will tell you the exact installed version
Mike Wazowski
Mike WazowskiOP13mo ago
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.
No description
Mike Wazowski
Mike WazowskiOP13mo ago
Hi there @toeknee I've tried it again from 0, it still returns to this error
Mike Wazowski
Mike WazowskiOP13mo ago
No description
awcodes
awcodes13mo ago
Do your have any plugins installed?
cheesegrits
cheesegrits13mo ago
Can you show the whole stack trace from the error.
Mike Wazowski
Mike WazowskiOP13mo ago
[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
Mike Wazowski
Mike WazowskiOP13mo ago
HI @awcodes For Plugins here's everything that is installed
No description
ZedoX
ZedoX13mo ago
Do: composer show filament/filmanent To check the installed filament version
Mike Wazowski
Mike WazowskiOP13mo ago
Wierd it's saying its not installed, but when I check the vendor>bin
No description
Mike Wazowski
Mike WazowskiOP13mo ago
Filament v3 is there already
No description
Mike Wazowski
Mike WazowskiOP13mo ago
I can't do artisan commands as well due to this error.
i really can't play that
There is a typo. Try composer show filament/filament
Mike Wazowski
Mike WazowskiOP13mo ago
it seems it says here that it's on 2 still but on the vendor and composer json it's already 3
ZedoX
ZedoX13mo ago
Run composer update
Mike Wazowski
Mike WazowskiOP13mo ago
Sorry this was from a separate App lol. Here's the output from this App. Everything seems to be fine.
No description
Mike Wazowski
Mike WazowskiOP13mo ago
But I still have this issue.
toeknee
toeknee13mo ago
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
Mike Wazowski
Mike WazowskiOP13mo ago
Unfortunately there's no more detailed Stack Trace - In regards to the App - I haven't gone through it yet due to the error
Clark Dave
Clark Dave13mo ago
Hi I'm facing the same issue when upgrading the existing application from Filament V2 to V3
toeknee
toeknee13mo ago
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
Mike Wazowski
Mike WazowskiOP13mo ago
No it's on the Vendor from the filament/filament it's set to protected Might be needed to update to public?
toeknee
toeknee13mo ago
Do you have any plugins?
Mike Wazowski
Mike WazowskiOP13mo ago
No description
toeknee
toeknee13mo ago
ahhh I have just seen, it's deprecated
Mike Wazowski
Mike WazowskiOP13mo ago
Here's everything that we're using from v2
No description
Mike Wazowski
Mike WazowskiOP13mo ago
now upgraded to v3 Yeah, but we're usign the latest Filament version
toeknee
toeknee13mo ago
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
Mike Wazowski
Mike WazowskiOP13mo ago
We've added this already now, we're using it like this in all of our forms
No description
Mike Wazowski
Mike WazowskiOP13mo ago
Still has the same error unfortunately
No description
toeknee
toeknee13mo ago
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
Mike Wazowski
Mike WazowskiOP13mo ago
I've removed everything regarding statePath now but still results the same
No description
Dan Harrin
Dan Harrin13mo ago
try removing /vendor and reinstalling
toeknee
toeknee13mo ago
He has
Mike Wazowski
Mike WazowskiOP13mo ago
I've just done it now, unfortunately still the same this is with a fresh re-install
Dan Harrin
Dan Harrin13mo ago
are you using InteractsWithForms anywhere in your codebase make sure you are not using it on any Filament pages, they already have it
toeknee
toeknee13mo ago
Ahh of course, because we changed it in V3
Mike Wazowski
Mike WazowskiOP13mo ago
Ohh Okay, let me try it just a sec. Thanks
Mike Wazowski
Mike WazowskiOP13mo ago
It worked, that errors gone. Thank you Just to confirm is it similar to this error?
No description
Mike Wazowski
Mike WazowskiOP13mo ago
Since I'm using HasForms as well
No description
Mike Wazowski
Mike WazowskiOP13mo ago
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.
Dan Harrin
Dan Harrin13mo ago
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
Mike Wazowski
Mike WazowskiOP13mo ago
Got it, Thanks so much @Dan Harrin
Want results from more Discord servers?
Add your server