Closed SaschaGalley closed 10 years ago
I reverted this change because ORM::count_relations()
already supports ORM parameters.
The problem I encountered was that Auth::login() wasn't working properly. In line 90:
if ($user->has('roles', ORM::factory('Role', array('name' => 'login'))) AND $user->password === $password)
Will do the following:
// return 1 = 0, because count(ORM) will return 0 although it's loaded
var_dump(count($far_keys)); // dumps int(0)
return $count === count($far_keys);
Any ORM model or a single primary key (int) will always fail this comparison.
Added further checks to return FALSE if far_keys is an instance of ORM and not loaded and build an array if $far_keys was not an array.