This forum is archived. Posts are preserved for historical reference. For current help, join us on Discord.

Help with init.php

In Off-topic Discussions · Started by marciocaparica on 2017-01-09 5:53 pm · 6081 views · 1 replies

Hello there!

I've finally set the public version of the project I've been working on the last few weeks - it's on

http://site.veracruz.edu.br/registrodehoras/index.php

As you guys can see, I keep on getting the message

"Notice: Trying to get property of non-object in D:\xampp\htdocs\registrodehoras\usersc\includes\navigation.php on line 15

Notice: Trying to get property of non-object in D:\xampp\htdocs\registrodehoras\users\helpers\us_helpers.php on line 485"
.

I'm pretty sure that on the path that Userspice got during installation, it shouldn't be anything like "D:\xampp". The installation said it should be fixed in init.php . I'm looking at init.php right now, though, and I can't find what I should change so that this won't happen anymore. I think that several of the other pages that are not working at the moment aren't working because of that.

Can you help me please?

Thank you

M!
Ok. So it looks like that has something to do with you trying to get information that is requiring the user to be logged in. I'm not sure what's going on with your navigation because that's a custom file. If you want, you can post your whole navigation.php file to pastebin or hastebin and I'll take a look, but I'm going to guess that you have something going on in line 15 or around it that is looking for a user id or something like that.

Try logging in and then going to the home page. My guess is that the error will go away.

If you're doing some sort of logic on line 15, you could do something like
if($user->isLoggedIn()){
//whatever you were doing on line 15
}