I do a lot of storing objects in session, however when I attempt to do this with a QDrupal node, I get __PHP_Incomplete_Class errors.

I'm taking this to be due to the fact that the object class definition isn't being loaded until after the session has been started.

Which implies that the QApplication's Autoload function isn't being defined early enough in the page load.

Does that sound right, and what can we do about it?

Comments

smite’s picture

For right now, I run the following at the begining of each node:

foreach($_SESSION as $key=>$value)
	if($value instanceof __PHP_Incomplete_Class)
		$_SESSION[$key] = unserialize(serialize($value));

But this doesn't work for AJAX calls, and isn't a very clean solution.

smite’s picture

Status: Active » Needs review

Moving that code to qdrupal_link_view in qdrupal_link.php, after the qdrupal_prepend call seems to fix the AJAX support as well, and removes the requirement of placing it on each linked page.

mikehostetler’s picture

Status: Needs review » Closed (won't fix)