Jump to content

Problem with session variables/ non-object


Pablos
 Share

Recommended Posts

My session variables are all taking the value of the last one set. $session->getAll() returns '0'. Seems like they're not being set at all.

I've turned on debug in config and I'm getting the following errors:

Notice: Trying to get property of non-object in /Users/Pablo/Sites/shoptest/wire/core/PageAccess.php on line 26

Notice: Trying to get property of non-object in /Users/Pablo/Sites/shoptest/wire/core/PageAccess.php on line 28

Notice: Undefined variable: cartActive in /Users/Pablo/Sites/shoptest/site/templates/shophead.inc on line 79

Notice: Undefined variable: itemRemoved in /Users/Pablo/Sites/shoptest/site/templates/shophead.inc on line 131

The last two are the session variables.

Thanks for any advice,

Paul
 

Link to comment
Share on other sites

I'm using the 'true'/'false' string to track whether my shopping cart code should be displayed when the page is reloaded. I'm not setting the variable from within a function.

In fact, even with the session variable assignment removed, I still get

Notice: Trying to get property of non-object in /Users/Pablo/Sites/shoptest/wire/core/PageAccess.php on line 26
Notice: Trying to get property of non-object in /Users/Pablo/Sites/shoptest/wire/core/PageAccess.php on line 2

Link to comment
Share on other sites

Looks like it's not about session. Line 2? There's nothing. Make sure PW is installed and there's all files and that they're not corrupted or missing. Sometimes it happens when upload to a server.

Link to comment
Share on other sites

Sorry, that should have been line 28, not line 2.

Edit: It's actually on my local server, so I haven't moved it since starting the project.

Can I simply download Processwire and replace the wire folder?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...