? ? Success

User tests: Successful: Unsuccessful:

avatar evostudio-it
evostudio-it
27 Oct 2016

Pull Request for Issue # .

Summary of Changes

Testing Instructions

Documentation Changes Required

Return "Fatal error: Class 'stdclass' not found" with php7

avatar evostudio-it evostudio-it - open - 27 Oct 2016
avatar evostudio-it evostudio-it - change - 27 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Oct 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 27 Oct 2016
Category MS SQL Libraries
avatar mbabker
mbabker - comment - 27 Oct 2016

This isn't a valid fix, actually it breaks one of the API features.

avatar zero-24
zero-24 - comment - 27 Oct 2016

@evostudio-it

"Fatal error: Class 'stdclass' not found" with php7

hmm if the stdclass can'T be found this sounds like a bigger problem as it is build in the core of php. ?

Can you please add a way to reproduce this error?

avatar zero-24 zero-24 - change - 27 Oct 2016
Labels Added: ?
avatar evostudio-it
evostudio-it - comment - 27 Oct 2016

$app = JFactory::getApplication();
//create istance on sqlServer
$dbSqlServer= array();
$dbSqlServer['driver'] = 'sqlsrv';
$dbSqlServer['host'] = '192.168.1.1';
$dbSqlServer['user'] = 'sa';
$dbSqlServer['password'] = 'password';
$dbSqlServer['database'] = 'dbSqlServer';
$dbSqlServer['prefix'] = '';
$app->set('sqlServer', $dbSqlServer);

//then i use first MySql then SqlServer
$dbconenction = $app->get('sqlServer');
$db = JDatabase::getInstance($dbconenction);
//set query .... then i get data...
$db->setQuery('select......');
$items = $db->loadObjectList(); //here get error

Joomla configured on mysql database and this code part is in our module.
If you want, I will send more details next week...

avatar mbabker
mbabker - comment - 27 Oct 2016

It's still an invalid fix. I know this has come up numerous times, but there is not a core Joomla issue here.

stdClass is part of the core PHP API. You cannot conceivably run the PHP binary with this missing.

Removing this parameter removes part of the Joomla API's features (supported by all database engines) where you specify the type of object the data is loaded into.

I do not believe there is something we can patch in Joomla to address this issue. As annoying as it is.

avatar photodude
photodude - comment - 27 Oct 2016

I read somewhere that this could be related to a misuse of PHP 5.3 namespaces. stdClass is in the global namespace we possibly need to write $class = '\stdClass' or add a use statement on the top of the file.

avatar mbabker
mbabker - comment - 27 Oct 2016

Except our code in the libraries/joomla directory is in the global namespace so that in itself should not be the issue (I'd expect that more with the namespaced Framework code than the code here in the CMS).

Even if it were related to namespaces, usually the error is something like class Joomla\Database\stdclass cannot be found and would indicate what namespace the class is being searched for in.

avatar brianteeman
brianteeman - comment - 20 May 2017

I am closing this at this time for the reasons stated by @mbabker above

avatar brianteeman brianteeman - change - 20 May 2017
The description was changed
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-05-20 12:35:26
Closed_By brianteeman
avatar brianteeman brianteeman - close - 20 May 2017

Add a Comment

Login with GitHub to post a comment