ForestAdmin / forest-laravel

🌱 Laravel Liana for Forest Admin. This repo is no longer maintained. Please use laravel-forestadmin instead: https://github.com/ForestAdmin/laravel-forestadmin
GNU General Public License v3.0
4 stars 0 forks source link

Search feature when adding existing user to a many-to-many relation doesn't work #34

Closed henninghorn closed 7 years ago

henninghorn commented 7 years ago

When editing a model which has a belongsToMany relation to another model, the built-in search feature doesn't work.

It fires off a search query but response is always HTTP 500:

QueryException in Connection.php line 647: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'offset 0' at line 1 (SQL: select users.* from users where (LOWER(users.name) LIKE LOWER('%John%') or LOWER(users.email) LIKE LOWER('%John%') or LOWER(users.password) LIKE LOWER('%John%') or LOWER(users.remember_token) LIKE LOWER('%John%')) offset 0)

skaermbillede 2017-03-23 kl 17 03 13

arnaudbesnier commented 7 years ago

Hi @henninghorn not really sure how you reproduced this issue. Did you search for "John" in your Users collection panel?

It seems that the generated MySQL query does not have a limit to come with the offset. I feel like this is the issue.

henninghorn commented 7 years ago

Hi @arnaudbesnier

Ah, sorry. Basically I had created two models, User and Event.

I had created 25 random users (through database seeding). I then went to Forest Admin and confirmed that these users could be seen. Then I went into "Events" (in Forest) where I created an event. Afterwards I wanted to add a relationship to one of the 25 created users. Forest picked up the relationship between Users and Events, so I clicked "Add existing user" and I was presented with a search field, and this is where the error appeared.

Basically the same view like this (from your Live Demo): skaermbillede 2017-03-23 kl 21 15 12

This works fine on your demo, but the Laravel implementation doesn't work.

arnaudbesnier commented 7 years ago

Perfect I know how to reproduce now!

arnaudbesnier commented 7 years ago

Hi @henninghorn , this is fixed in the new 0.0.19 Forest version.

henninghorn commented 7 years ago

@arnaudbesnier Great, thank you very much!

arnaudbesnier commented 2 years ago

Hi @henninghorn ,

The brand new Laravel agent for Forest Admin is available here: https://github.com/ForestAdmin/laravel-forestadmin

As we now have a team of dedicated developers for this new Laravel agent, be sure Forest Admin will provide a much better Laravel support experience compared to the one you had in the past for v1.

Forest Admin also evolved a lot in 4 years as an internal tool platform, don’t hesitate to give it another try, you should not be disappointed 🌲🌲🌲

Best Regards.