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();
}
Independent queries should be executed independently without interfering with each other in development mode as well.
I can't iterate all the records due to this behavior in development mode, it only executes loop only once.
Linux
PHP 7.2
MySQL 8
Joomla 3.10.10
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
Labels |
Added:
No Code Attached Yet
|
Possibly it is related to debug and not error reporting?
Might as well close it as the original author did not respond
Its related to debug yes.
Iirc this is fixed in 4.x can you please try it with the current Version 4.2.0 please?
Labels |
Added:
bug
|
The level of error reporting is setting the php error level reporting. It can NOT change anything