open-admin-org / open-admin

open-admin forked from z-song/laravel-ladmin. Removing jquery, now based on Bootstrap5, vanilla JS
https://open-admin.org
MIT License
255 stars 75 forks source link

Custom action popup form in grid cannot be submitted with error #72

Open takagaki-bb opened 1 year ago

takagaki-bb commented 1 year ago

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

bytebrain commented 1 year ago

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.