stevemo / cpanel

Admin Panel for Laravel 4
MIT License
203 stars 67 forks source link

Column not found error when creating/updating user #17

Closed ThePaavero closed 10 years ago

ThePaavero commented 10 years ago

I get an error when trying to create or update user data, it seems to fudge the column name:

SQLSTATE[42S22]: Column not found: 1054 Unknown column '/admin/users/1' in 'field list' (SQL: update laravel_template_users set id = ?, email = ?, updated_at = ?, /admin/users/1 = ? where id = ?) (Bindings: array ( 0 => '1', 1 => 'xxx.xxx@xxx.com', 2 => '2013-11-04 13:22:46', 3 => '', 4 => '1', ))

ThePaavero commented 10 years ago

It seems as if the URL segments string gets sucked into a key in the data array for some reason.

stevemo commented 10 years ago

I can't reproduce this error? Did you make any modification to the package? Are you using custom views for the edit and create?

ThePaavero commented 10 years ago

Nope, trying with a clean install and nothing to override anything in the package. When I dump out your validator class's (Stevemo\Cpanel\Services\Validators\Users\passes()) it looke like this: Array ( [_method] => PUT [first_name] => xxx [last_name] => xxxx [email] => xxx@xxx.com [_token] => xxxxxxxxxxxxx [/admin/users/2] => [id] => 2 )

I don't understand why that URL key gets in there (/admin/users/2) -- that's why it keeps choking. Any ideas? We get this on different environments (Ubuntu, OSX, Debian).

ThePaavero commented 10 years ago

I think it's Input::all() that sucks that extra key in. I'll investigate further as it seems this isn't a bug in your package. Thanks and sorry for your trouble.