open-admin icon indicating copy to clipboard operation
open-admin copied to clipboard

Custom action popup form in grid cannot be submitted with error

Open takagaki-bb opened this issue 1 year ago • 1 comments

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');
    }

image

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

takagaki-bb avatar May 31 '23 05:05 takagaki-bb

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.

bytebrain avatar Aug 01 '23 16:08 bytebrain