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

Trying to get property 'bio' of non-object #295

Closed
MusheAbdulHakim opened this issue Dec 14, 2021 · 5 comments
Closed

Trying to get property 'bio' of non-object #295

MusheAbdulHakim opened this issue Dec 14, 2021 · 5 comments

Comments

@MusheAbdulHakim
Copy link

When a user create an account that email is not verified and try to visit the profile page at the frontend, you get this error.
Also i have realize that, you are using the ids of the users in the profile page to get their information on the page. So i tried changing the values of the ids in the url and i was actually able to get the information of those users that existed in the database. This could be a security issue.

Creating default object from empty value

I also the above error when updating user info or when deleting to trash in the backend section.

@MusheAbdulHakim
Copy link
Author

Even after the emailed is verified, it still give me this error.

@nasirkhan
Copy link
Owner

Thank you for reporting the issue.

Unfortunately I could not reproduce the issue you mentioned. But from the subject of the issue I think for some reason your profile has not been created while creating new user. 'bio' is part of the 'userprofiles' table. Userprofile has an one to one relation with user. User profile page data are shown from the userprofiles table and if there is no entry found it may throw this type of error. Can you please check and confirm the number of rows in users and userprofiles are same in your application?

Id of an user is being used to show their profile. I think is a very common practice and here only some specific non sensitive data are shown. There are a number of other approaches can be taken but what you suggest?

I could not reproduce the user delete issue as well, can you please look into your error log and you may share here as well.

@MusheAbdulHakim
Copy link
Author

the users table and the userprofiles table do not have the same rows.But i suggest you make the bio column nullable since it is not in the register page.
This is my log file.
laravel-2021-12-14.log

@AiFxApp
Copy link

AiFxApp commented Apr 12, 2022

ErrorException
Attempt to read property "bio" on null.

Fresh install localhost.. followed your git instructions.. How do i solve this please?

@nasirkhan
Copy link
Owner

Hi @AiFxApp ,

Did you followed all the steps to install? You will need to seed the database to access the backend and some other features.

Please check the steps from here: https://github.com/nasirkhan/laravel-starter/wiki/Installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants