Wizard issue with missing $statePath
I have a livewire component wizard that seems to be hitting intermittent issues for a very few users, I'm unable to recreate the issue. We're running the site on a load balancer, so it might just be a server or two playing up.
I'm saving the form data to individual properties, rather than using $statePath, but occasionally the wizard seems to crash when moving to the next step
production.ERROR: Filament\Forms\Components\Wizard::Filament\Forms\Components{closure}(): Argument #2 ($statePath) must be of type string, null given,
Which seems to be related to:
from Wizard.php Any idea why it works 99% of the time, but occasionally falls over? We're on php 8.2 Thanks!
from Wizard.php Any idea why it works 99% of the time, but occasionally falls over? We're on php 8.2 Thanks!
2 Replies
You could try to create a custom component extending the
Wizard
and change it to null|string $statePath
If it works, probably this is a bugAh! good idea, I'll try that - weird that it's so difficult to recreate the bug
I think there must be some kind of bug, by type hinting null, the function seems to return false for if ($statePath !== $component->getStatePath()) {
return;
}
Then it runs the rest of the logic and all my conditionally hidden fields aren't showing until the final step. If I simply return at the top, the wizard works perfectly, at least it appears to. Is this safe to do?