Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FatalErrorException in HasPermissionInheritance.php line 57: #23

Closed
limweb opened this issue Mar 17, 2015 · 7 comments
Closed

FatalErrorException in HasPermissionInheritance.php line 57: #23

limweb opened this issue Mar 17, 2015 · 7 comments

Comments

@limweb
Copy link

limweb commented Mar 17, 2015

FatalErrorException in HasPermissionInheritance.php line 57:
Call to a member function getKey() on a non-object
in HasPermissionInheritance.php line 57

@limweb
Copy link
Author

limweb commented Mar 17, 2015

// ---- get user by id
public function getUserbyid($id){
$u = User::find($id);
$u->getPermissions();
$u->getRoles();
dump($u);
}

Error at call this function

Thanks.

@limweb
Copy link
Author

limweb commented Mar 17, 2015

in line 21
foreach ($inherits as $name => $inherit_id) {
if ( is_null($inherit_id) ) continue;
I'm change to
if ( is_null($inherit_id) || empty($inherit_id) ) continue;

in database field is int can't be null is will fill zero 0

@Mythos
Copy link

Mythos commented Mar 17, 2015

Is your column nullable? If not you have to alter it to be nullable as this has been changed in 4f6ffd4 due to #21

@kodeine
Copy link
Owner

kodeine commented Mar 17, 2015

@Mythos @limweb

So FatalErrorException is fixed because of 4f6ffd4 right?

@limweb
Copy link
Author

limweb commented Mar 18, 2015

thanks.

@kodeine kodeine added the bug label Mar 18, 2015
@Mythos
Copy link

Mythos commented Mar 18, 2015

@limweb
Has this fixed your problem?

@kodeine kodeine added bug: solved and removed bug labels Mar 18, 2015
@kodeine
Copy link
Owner

kodeine commented Mar 18, 2015

@Mythos @limweb

This should be fixed now as i pushed it with is_null($inherit_id) || empty($inherit_id) this way for other people their apps wont break by not having nullable() in their inherit_id field.

@kodeine kodeine closed this as completed Mar 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants