No Code Attached Yet bug
avatar ruchit-parikh
ruchit-parikh
8 Aug 2022

Steps to reproduce the issue

When we set the error_reporting to highest and when we are processing multiple queries at same time, like consider using an Iterator and while processing those items which we fetch through iterator, if we make any other query on getDbo of JFactory, our iteration ends because query gets overridden.

$db       = Factory::getDbo();
$query    = $db->getQuery(true);
$iterator = $db->setQuery($query)->getIterator();

foreach ($iterator as $o)
{
   // This is just an example. If we have some another query while processing it causes loop to terminate. 
   $query2  = $db->getQuery(true);
   $db->setQuery($query2)->execute();
}

Expected result

Independent queries should be executed independently without interfering with each other in development mode as well.

Actual result

I can't iterate all the records due to this behavior in development mode, it only executes loop only once.

System information (as much as possible)

Linux
PHP 7.2
MySQL 8
Joomla 3.10.10

Additional comments

It also throws this errors

Warning: mysqli_fetch_object(): Couldn't fetch mysqli_result in C:\xampp\htdocs\staging\libraries\joomla\database\iterator\mysqli.php on line 41

Warning: mysqli_free_result(): Couldn't fetch mysqli_result in C:\xampp\htdocs\staging\libraries\joomla\database\iterator\mysqli.php on line 53
avatar ruchit-parikh ruchit-parikh - open - 8 Aug 2022
avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Aug 2022
avatar ruchit-parikh ruchit-parikh - change - 8 Aug 2022
The description was changed
avatar ruchit-parikh ruchit-parikh - edited - 8 Aug 2022
avatar ruchit-parikh ruchit-parikh - change - 8 Aug 2022
The description was changed
avatar ruchit-parikh ruchit-parikh - edited - 8 Aug 2022
avatar ruchit-parikh ruchit-parikh - change - 8 Aug 2022
The description was changed
avatar ruchit-parikh ruchit-parikh - edited - 8 Aug 2022
avatar brianteeman
brianteeman - comment - 8 Aug 2022

The level of error reporting is setting the php error level reporting. It can NOT change anything

avatar richard67
richard67 - comment - 14 Aug 2022

Possibly it is related to debug and not error reporting?

avatar brianteeman
brianteeman - comment - 14 Aug 2022

Might as well close it as the original author did not respond

avatar ruchit-parikh
ruchit-parikh - comment - 17 Aug 2022

Its related to debug yes.

avatar HLeithner
HLeithner - comment - 17 Aug 2022

Iirc this is fixed in 4.x can you please try it with the current Version 4.2.0 please?

avatar Hackwar Hackwar - change - 22 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 22 Feb 2023

Add a Comment

Login with GitHub to post a comment