?
avatar rudisten1
rudisten1
25 Jul 2016

Steps to reproduce the issue

install joomla using a SQL Server db as the main database
create a user account giving it the access level Registered
login in the front end with the newly created user account

Expected result

going to the default home page (in this case the featured articles)

Actual result

site error as follow:

An error has occurred while processing your request.

You may not be able to visit this page because of:

an out-of-date bookmark/favourite
a mistyped address
a search engine that has an out-of-date listing for this site
you have no access to this page

Go to the Home Page

Home Page

If difficulties persist, please contact the System Administrator of this site and report the error below.

0 new JDatabaseIteratorSqlsrv(*string*, cursor) 

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

avatar rudisten1 rudisten1 - open - 25 Jul 2016
avatar alikon
alikon - comment - 25 Jul 2016

are you using some 3party extensions?

avatar rudisten1
rudisten1 - comment - 26 Jul 2016

no. I was able to find out that the issue arises only with php 7, not with php 5.6


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

avatar williamsandy
williamsandy - comment - 4 Aug 2016

Can confirm this happens with fresh install of Joomla 3.6.

I found that this issue is occurring because the JDatabaseIterator class constructor cannot find the stdClass in PHP 7. The issue seems to resolve if you explicitly specify to PHP to look in the global namespace. Why you have to do this in this case? I don't know. I can only assumme some namespace is being used in one of the classes specific to SQL Server

So change in the JDatabaseDriver at libraries\joomla\database\driver.php

on line 1242

public function getIterator($column = null, $class = 'stdClass')

to

public function getIterator($column = null, $class = '\stdClass')

This is enough to fix this specific issue . However you should update the JDatabaseIterator class as well to avoid a similar issue.

So change in JDatabaseDriver at libraries\joomla\database\iterator.php

on line 76

public function __construct($cursor, $column = null, $class = 'stdClass')

to

public function __construct($cursor, $column = null, $class = '\stdClass')


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

avatar mbabker
mbabker - comment - 4 Aug 2016

That shouldn't be necessary. All code in the libraries/Joomla directory is
in the global namespace. Seems weird that it's acting otherwise.

On Thursday, August 4, 2016, Andrew notifications@github.com wrote:

Can confirm this happens with fresh install of Joomla 3.6.

I found that this issue is occurring because the JDatabaseIterator class
constructor cannot find the stdClass in PHP 7. The issue seems to resolve
if you explicitly specify to PHP to look in the global namespace. Why you
have to do this in this case? I don't know. I can only assumme some
namespace is being used in one of the classes specific to SQL Server

So change in the JDatabaseDriver at libraries\joomla\database\driver.php

on line 1242

public function getIterator($column = null, $class = 'stdClass')

to

public function getIterator($column = null, $class = '\stdClass')

This is enough to fix this specific issue . However you should update the
JDatabaseIterator class as well to avoid a similar issue.

So change in JDatabaseDriver at libraries\joomla\database\iterator.php

on line 76

public function __construct($cursor, $column = null, $class = 'stdClass')

to

public function __construct($cursor, $column = null, $class = '\stdClass')

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/11297
https://issues.joomla.org/tracker/joomla-cms/11297.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#11297 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfobDCwmjjoSL0r25ghjcf0D-eNj4nks5qcefOgaJpZM4JUGWU
.

avatar sweco-semhul
sweco-semhul - comment - 26 Nov 2016

Seeing the same problem on Joomla 3.6.4, PHP 7.0.12, Windows Server 2012 R2, IIS 8.5 MS SQL Server 2008 R2.
@williamsandy solution above solved the problem

avatar brianteeman brianteeman - change - 4 Dec 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-12-04 15:39:29
Closed_By brianteeman
avatar brianteeman brianteeman - close - 4 Dec 2016
avatar brianteeman
brianteeman - comment - 4 Dec 2016

Closed as we have a PR for testing #13082

Add a Comment

Login with GitHub to post a comment