0

I am using Laravel BackPack Pro and I can't get full modal form for inline-create relation... It was working early, but after some coding and updates I found that this feature dosen't work any more with no any errors =\

My main model is Image, which has Tags (many-to-many) and Category (belongs-to) related models

settings for create operation for images

Category inline-create still working! But tags - not. I have no any errors, but the response of modal request - returns with only initial form, buttons and with NO any fields:

NO any fields, only buttons

Common tag create action is Ok, and I did't rewrite any modal views.

Can someone explain what can be wrong?

2
  • upd: if I use $this->crud->setFromDb(); in tag crud controller, it works good. but my manually setupCreateOperation() is pretty simply and have no errors =\ Commented Jun 30, 2022 at 22:28
  • Please show the code Commented Jul 1, 2022 at 11:36

1 Answer 1

0

Ok, I got it! My setup tag crud controller was

public function setup() {
   ...
   $this->crud->operation(['create', 'update'], function () {
      ...
   }  
}

But when I exclude create operation to separate method

protected function setupCreateOperation() {
   ...
}

all started working as expected!

Sign up to request clarification or add additional context in comments.

3 Comments

I guess you found an inconsistency, I will open an issue for it. Inline create only calls the setupCreateMethod but does not get the setup from callbacks.
Yes, I think ti is issue too, because it is unexpected =\ I use $this->crud->operation(['create', 'update'] for DRY purpose and got other behaviour
Thanks for the explanation and sorry for the bad experience. I've sent a PR to fix this, should be tagged in the next version that will launch in the next days.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.