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
toeknee9mo ago
Your functions are protected but they should be public
Mike Wazowski
Mike Wazowski9mo ago
Hi there, all of them are public like this: The error is on the vendor
No description
toeknee
toeknee9mo 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 Wazowski9mo 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
toeknee9mo ago
Exactly my point which is why I thought forms was out of date. Can you update Filament
Mike Wazowski
Mike Wazowski9mo ago
I've updated it as well, since I'm updating the app from V2 to V3.
No description
toeknee
toeknee9mo ago
run: php artisan about it will tell you the exact installed version
Mike Wazowski
Mike Wazowski9mo 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 Wazowski9mo ago
Hi there @toeknee I've tried it again from 0, it still returns to this error
Mike Wazowski
Mike Wazowski9mo ago
No description
awcodes
awcodes9mo ago
Do your have any plugins installed?
cheesegrits
cheesegrits9mo ago
Can you show the whole stack trace from the error.
Mike Wazowski
Mike Wazowski9mo 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 Wazowski9mo ago
HI @awcodes For Plugins here's everything that is installed
No description
ZedoX
ZedoX9mo ago
Do: composer show filament/filmanent To check the installed filament version
Mike Wazowski
Mike Wazowski9mo ago
Wierd it's saying its not installed, but when I check the vendor>bin
No description
Mike Wazowski
Mike Wazowski9mo ago
Filament v3 is there already
No description
Mike Wazowski
Mike Wazowski9mo 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 Wazowski9mo ago
it seems it says here that it's on 2 still but on the vendor and composer json it's already 3
ZedoX
ZedoX9mo ago
Run composer update
Mike Wazowski
Mike Wazowski9mo 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 Wazowski9mo ago
But I still have this issue.
toeknee
toeknee9mo 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 Wazowski9mo 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 Dave9mo ago
Hi I'm facing the same issue when upgrading the existing application from Filament V2 to V3
toeknee
toeknee9mo 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 Wazowski9mo ago
No it's on the Vendor from the filament/filament it's set to protected Might be needed to update to public?
toeknee
toeknee9mo ago
Do you have any plugins?
Mike Wazowski
Mike Wazowski9mo ago
No description
toeknee
toeknee9mo ago
ahhh I have just seen, it's deprecated
Mike Wazowski
Mike Wazowski9mo ago
Here's everything that we're using from v2
No description
Mike Wazowski
Mike Wazowski9mo ago
now upgraded to v3 Yeah, but we're usign the latest Filament version
toeknee
toeknee9mo 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 Wazowski9mo ago
We've added this already now, we're using it like this in all of our forms
No description
Mike Wazowski
Mike Wazowski9mo ago
Still has the same error unfortunately
No description
toeknee
toeknee9mo 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 Wazowski9mo ago
I've removed everything regarding statePath now but still results the same
No description
Dan Harrin
Dan Harrin9mo ago
try removing /vendor and reinstalling
toeknee
toeknee9mo ago
He has
Mike Wazowski
Mike Wazowski9mo ago
I've just done it now, unfortunately still the same this is with a fresh re-install
Dan Harrin
Dan Harrin9mo 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
toeknee9mo ago
Ahh of course, because we changed it in V3
Mike Wazowski
Mike Wazowski9mo ago
Ohh Okay, let me try it just a sec. Thanks
Mike Wazowski
Mike Wazowski9mo ago
It worked, that errors gone. Thank you Just to confirm is it similar to this error?
No description
Mike Wazowski
Mike Wazowski9mo ago
Since I'm using HasForms as well
No description
Mike Wazowski
Mike Wazowski9mo 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 Harrin9mo 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 Wazowski9mo ago
Got it, Thanks so much @Dan Harrin
Want results from more Discord servers?
Add your server
More Posts
Validate form from custom Action button - maybe bugI've added custom action button on resource edit page and I want to validate form before proceeding Unique rule with MorphToSelect fieldsHi ! I'm trying to create a form for a ``"relations"`` polymorphic table I have in my database to maQueue FileUpload(s) for large data (videos/images)I have run into a situation that I have searched far and wide but can't see an answer for. ImagineHow to control order of images in spatie media library field while saving?I have a SpatieMediaLibraryFileUpload field for images in my Filament resource. It's multiple. When image uploader to fill problemHi, i'm trying to fill image uploader from model. This is model return; `attributes: array:11 [▼ Display count of relationship in table column where pivot value = somethingHi, I need to access the many to many relationship of a model in a column and display the count of Custom Action that calls "save" doesn't actually save the modelSo I'm trying to put a save button elsewhere in an Edit page ``` Grid::make('card_payment') ->viInteract with input state and events using AlpineI'm trying to create a custom Radio input that would allow to render another text input next to optirecordSelectSearchColumns on GetRelationHello friends, I have a question, I'm in a get relation and I want in an attach action to do a searcHow to make two column section using grid?Hello everyone, I just want to ask how do I make a 2 column section using grid? I have set the colum