?
avatar rudisten1
rudisten1
26 Jul 2016

Steps to reproduce the issue

use a different db driver (SQL Server) for a list view

Expected result

displaying the list view

Actual result

Fatal error: Class 'stdclass' not found in C:\inetpub\wwwroot\joomla7mysql\libraries\joomla\database\driver\mysqli.php on line 886

System information (as much as possible)

php 7
sqlsrv extension 4.0 non thread safe
IIS 7
joomla 3.6
SQL Server 2014

Additional comments

the issue doesn't arise using php 5.6 instead of php 7

avatar rudisten1 rudisten1 - open - 26 Jul 2016
avatar mbabker
mbabker - comment - 26 Jul 2016

I would suggest you've got a PHP issue then because stdClass is a part of the base PHP API and class names in PHP are case insensitive (only autoloaders seem to enforce a case sensitivity).

avatar rudisten1
rudisten1 - comment - 26 Jul 2016

php issue only for newly entered php 7?

avatar brianteeman
brianteeman - comment - 26 Jul 2016

why is it even looking in the mysqli.php file if this is a sql server install

avatar rudisten1
rudisten1 - comment - 26 Jul 2016

a complete mystery

avatar blakekidney
blakekidney - comment - 5 Oct 2016

I ran into the same issue. The problem is that 'stdclass' is being passed as a parameter to the mysqli_fetch_object() which is then causing an error because it should be 'stdClass' and not 'stdclass'. To fix the issue, I did added a line of code in the /libraries/joomla/database/driver/mysqli.php file on line 886 that corrects the issue.

protected function fetchObject($cursor = null, $class = 'stdClass')
{
   if($class == 'stdclass') $class = 'stdClass';
   return mysqli_fetch_object($cursor ? $cursor : $this->cursor, $class);
}


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/11311.

avatar mbabker
mbabker - comment - 5 Oct 2016

That really shouldn't be necessary. Class names in PHP are case insensitive. I honestly suspect there is some environmental issue at play here and that there isn't something that could be patched in core to fix.

avatar csthomas
csthomas - comment - 6 Oct 2016

I can not replicate it.

  1. On which version (full) of php the error occurs?
  2. Which extension generate that error?
  3. Can you replicate it in a simple script as below?
  4. Does the error occur if you replace 'stclass' with '\stdclass'?

Example:

// Load necessary libs
require 'console.php';

$db = JFactory::getDbo();

$db->setQuery('SELECT * FROM #__users');
$row = $db->loadObject('stdclass');

print_r($row);
avatar blakekidney
blakekidney - comment - 6 Oct 2016

We ran into some other issues. We thought these issues were related to PHP 7, so we moved back to PHP 5.6. We then setup the same site in a dev environment and could not replicate the issue. We then upgraded the site back to PHP 7 and all works well. The issue is not arising. I am not sure why. I wonder if something in the opcache was causing a conflict that stopped once cleared.

avatar brianteeman
brianteeman - comment - 6 Oct 2016

OK - closed

avatar brianteeman brianteeman - change - 6 Oct 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-10-06 16:54:45
Closed_By brianteeman
avatar brianteeman brianteeman - close - 6 Oct 2016
avatar blakekidney
blakekidney - comment - 12 Oct 2016

Unfortunately, this error surfaced again. This time, I used opcache_reset() to clear the opcache and the error was resolved. This would indicate the problem exists within the opcache. I have yet to figure out how to reproduce the error.

avatar csthomas
csthomas - comment - 18 Feb 2017

It may solve your problem #14137

Add a Comment

Login with GitHub to post a comment