Jump to content

Recommended Posts

Posted

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
 

Posted

And the code around it?

Is $session existent in scope?

Try wire("session")->$cartActive instead if in a function.

Posted

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

Posted

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.

Posted

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?

Posted

OK, I've got it sorted now. I remade the template and repopulated it. No error messages and session variables are working perfectly.

Thanks for the replies,

Paul

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
  • Recently Browsing   0 members

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