hi,
i just did some crazy stuff (no usage of index.php) - everthing works except
the following message:
Notice: Trying to get property of non-object in
/web/oxid-ce/www/core/oxlang.php on line 465 Notice
so, i have tried to debug. it`s somehow a circle of an inconsistent oxconfig
and the usage of error_reporting( E_ALL ^ E_NOTICE ) in index.php.
line 393 in oxconfig.php does the following stuff:
//starting up the session
$this->getSession()->start();
$sShopID = $this->getShopId();
// load now
$this->_loadVarsFromDb( $sShopID );
oxsession::start tries to use getShopUrl() on oxconfig. getShopUrl also uses
languages to build the url. problem: languages are loaded from db -> 3 lines
later :) why to start session before loading config-data from db? the
oxconfig::getShopId() does not only return an I, it also sets the shopId to
session.
you can fix the problem with some little changes in oxconfig.
first change - change the top block to:
$sShopID = $this->getShopId();
// load now
$this->_loadVarsFromDb( $sShopID );
//starting up the session
$this->getSession()->start();
oxSession::setVar( 'actshop', $this->_iShopId );
second change - new getShopId() - removal of session value set:
public function getShopId()
{
if ( $this->_iShopId !== null )
return $this->_iShopId;
$this->_iShopId = $this->getBaseShopId();
return $this->_iShopId;
}
the biggest advantage of these changes:
you are now able to extend oxsession and all the other classes that are
loaded first time after oxconfig::init()
i`d like to see oxid to use that patch. second wish: please remove your
error_reporting in your test enviroment. that will make code more cleaner.
thanks && nice weekend.
sven
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general