Property [$form] not found on component: [app.filament.resources.process-resource.pages.view-process

So i have a custom action to aprove the process status, it was working before, but know i got this error below https://flareapp.io/share/VmeMQLAm My code: https://pastecode.io/s/j7awitrj Any ideia what can be causing this?
Flare
Property [$form] not found on component: [app.filament.resources.process-resource.pages.view-process] - The error occurred at http://cloft2.test/processes/8387
16 Replies
toeknee
toeknee13mo ago
That means you don't have the HasForms implemeneted on the Component
tiago.pereira
tiago.pereira13mo ago
but im not using any custom view wait let me check the view resource
toeknee
toeknee13mo ago
You are using: app.filament.resources.process-resource.pages.view-process If you go to the component view-process you will see that hasForms has not been implemented, but you are calling the form within the resource. You probably want to load it as disabled for reading
tiago.pereira
tiago.pereira13mo ago
yes i have a view only page im not understanding, on the view-process there is no hasForms but how was it working before? and on the documention i see the information about hasForm but only when not using the admin panel On my view process it extends ViewRecord that i think already has forms implemented
Dennis Koch
Dennis Koch13mo ago
If you extend ViewRecord why do you define a custom $view then?
tiago.pereira
tiago.pereira13mo ago
i dont have any custom view this was working and im did touched for a few weeks now i was testing the full system and this stoped working i dont know why yet
Dennis Koch
Dennis Koch13mo ago
Sorry confused it with the livewire Alias. Can you share the viewprocess code?
tiago.pereira
tiago.pereira13mo ago
sure https://pastecode.io/s/4zpbsec7 even when i try to delete with the default delete action, it deletes the record but same error is shown maybe it has something to do with the edit action
Dennis Koch
Dennis Koch13mo ago
Hm. Nothing obvious. Does it only happen after clicking an action? What happens if you remove all actions?
tiago.pereira
tiago.pereira13mo ago
only happens when clicking in the action cancell action and edit work fine aprove and delete both happens the same error
Dennis Koch
Dennis Koch13mo ago
Remove some stuff until it works. Maybe this: ->action(fn () => $this->record->aprove()) needs to be ->action(fn ($record) => $record->aprove()) Same for delete
tiago.pereira
tiago.pereira13mo ago
Call to a member function aprove() on null that way record is null
Dennis Koch
Dennis Koch13mo ago
What about ->action(fn ($livewire) => $livewire->record->aprove())
tiago.pereira
tiago.pereira13mo ago
i deleted everything from actions and know tried to find the issue now its giving another error when saving the updated record after change the status Unhandled match case 'error' but this is not from filament now
Dennis Koch
Dennis Koch13mo ago
The error message is pretty obvious, right?
tiago.pereira
tiago.pereira13mo ago
was a field that was no nullable now back to initial error, if i remove all other actions and keep the aprove one everything works now trying to add action by action to see wich one causes de issue when i put this action it starts giving the same error Action::make('cancel') ->label(('filament::resources/pages/edit-record.form.actions.cancel.label')) ->url($this->previousUrl ?? $resource::getUrl()) ->color('secondary'),]; issue is here if i remove this $this->previousUrl it works fine should this work this way also? Action::make('cancel') ->label(('filament::resources/pages/edit-record.form.actions.cancel.label')) ->action(fn() => redirect()->back()) ->color('secondary'), i was able to solve it like this Action::make('cancel') ->label(__('filament::resources/pages/edit-record.form.actions.cancel.label')) ->url(fn() => url()->previous()) ->color('secondary'),