FrozenNode / Laravel-Administrator

An administrative interface package for Laravel
http://administrator.frozennode.com/
MIT License
1.94k stars 503 forks source link

[bug]: "update_options" method is not always called in constrained relationships #511

Open AleksMeshkov opened 10 years ago

AleksMeshkov commented 10 years ago

Hi! I'm trying http://administrator.frozennode.com/docs/field-type-relationship (Constraining Relationships chapter).

That's an amazing feature. Thank's for that!

But I think I'v found a bug about it.

I have a User model that is related to Country and City models. So it's a complete analogy with the examples given on the site (Theater, City and a State models example) except that instead of Theater I have a User model.

Issue comes out when I create a new user. No matter which country I choose - I get all the cities in the table that are not related to selected country :-(

But if I click on other existing user record and then try to create new one - everything goes fine.

I tried to look through outgoing XHR's with the help of Chrome's web inspector and I figured out that "update_options" ajax request is not called when the issue happens.

If I'm correct problem is somewhere in runConstraintsQueue function (line 1262 in the admin.js file)

Or maybe it happens because of setTimeout functions?

Could you please look through this code?

ifox commented 10 years ago

+1

pupaxxo commented 10 years ago

I've got this bug at the first try, example: I open the page, I try to create new user and it doesn't work, i close the box, i reopen the box and now it work like a charm. Then i suggest to make i working also in filters. beacuse i've just tryed it and it doesn't work...

Derrick91 commented 9 years ago

I have the same problem with this also. Any updates?