CRUD: Can't use InlineCreate - array_filter() expects parameter 1 to be array, null given

Hi,

I wanna use the InlineCreate operation and do some things on create and update methods.

When I have the request as argument : public function store(StoreRequest $request){ ... } I have this error : Too few arguments to function App\\Http\\Controllers\\Admin\\OrderItemCrudController::store(), 0 passed

And when I remove request from argument, and use this in the method : $this->crud->request->request->get('...') I have this error : Cannot access protected property Backpack\\CRUD\\app\\Library\\CrudPanel\\CrudPanel::$request

Is there a way to get the request with the InlineCreate operation ?

Thanks for your help,

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 52 (27 by maintainers)

Commits related to this issue

Most upvoted comments

Could this be the order of the Operations ? I see Inline before the Create.

Not sure, but might worth try to clear our mind out of it.

EDIT:

F — * ---- * —K !!! It’s the order @tabacitu

It’s taken months, but that’s it. Once I moved InlineCreate below Create, it worked and everything saved properly

Yes! In LARGE BOLD LETTERS.

Jameson W Parker

On Sep 16, 2020, at 1:01 PM, Cristian Tabacitu notifications@github.com wrote:

Hahaha! Well… with the amount of effort everybody’s put into this… it was bound to be something small 😀 I was expecting one character but apparently it can be even smaller 😅

It makes sense now that you mention it @pxpm . InlineCreate can’t re-use Create’s setup, if it’s not already there. Very good catch!

I think the best fix is to add this to the docs 😀

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Ok my bad ! I see now that in Backpack 4.1.x we have to use : $this->crud->getRequest()

So it’s okay, sorry !

Edit: I encountered this issue but the problem was that I had manually set the routes for a CRUD controller, but didn’t update those routes when I upgraded backpack.

This works for me. Definitely keep me posted if you find a fix!

Thank you for your help. I really appreciate it.