open-admin
open-admin copied to clipboard
Custom action popup form in grid cannot be submitted with error
Describe the bug Error during submission in pop-up form. It does not seem to matter what type of form set up.
To Reproduce Set the following in the action class. This class extends OpenAdmin\Actions\Action.
public function form()
{
$this->textarea('body', 'body')->rules('required');
}
Expected behavior Please make sure it can be sent without error.
System
- Open-admin version v1.0.27
- PHP version 8.1.2
- Laravel Version v9.52.7
- OS: Windows 10
- Browser Chrome
To fix this with a workaround, change the model()
method in vendor/open-admin-org/open-admin/src/Form.php
to allow the interactor too.
/**
* @return Model|\OpenAdmin\Admin\Actions\Interactor\Form
*/
public function model(): Model|\OpenAdmin\Admin\Actions\Interactor\Form
{
return $this->model;
}
I have the same issue.