TheReverend403 / uPste

A file hosting application with an emphasis on serving technology communities.
https://u.pste.pw
GNU Affero General Public License v3.0
45 stars 8 forks source link

Trying to get property of non-object #11

Closed camjac251 closed 8 years ago

camjac251 commented 8 years ago

It seems like I'm getting this error. I'm not really sure what triggered it but here's the log. http://hastebin.com/iwifuranih.tex

TheReverend403 commented 8 years ago

Open the php artisan tinker shell, type...

\App\Models\UserPreferences::all();

And post the output here, omitting any sensitive information.

Also what version of the software are you running? Please provide the version number from git describe --tags.

On Mon, Apr 11, 2016 at 08:26:20PM -0700, camjac251 wrote:

It seems like I'm getting this error. I'm not really sure what triggered it but here's the log. http://hastebin.com/iwifuranih.tex


You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/TheReverend403/uPste/issues/11

TheReverend403 commented 8 years ago

OK, I've reproduced the problem. Your user was created before I made preferences automatically create on registration.

Open php artisan tinker and type foreach (\App\Models\User::all() as $user) { if (!$user->preferences) { \App\Models\UserPreferences::create(['user_id' => $user->id])->save(); } }

This should create default prefs for any user missing them.

camjac251 commented 8 years ago

Sorry for not replying. That seems to have fixed it.