What happened?
Description
We are experiencing an issue in one of our site where the UpdateElementSlugsAndUris is reporting a DivisionByZeroError. The issue is happening on this line:
$this->setProgress($queue, $this->_totalProcessed++ / $this->_totalToProcess);
Looks like $this->_totalToProcess can sometimes be 0 while in the foreach (Db::each($query) as $element) { loop
Steps to reproduce
- Run the UpdateElementSlugsAndUris job
- Randomly it can crash by a DivisionByZeroError
Craft CMS version
4.13.8
PHP version
8.3.16
Operating system and version
No response
Database type and version
PostgreSQL 16.6
Image driver and version
No response
Installed plugins and versions
What happened?
Description
We are experiencing an issue in one of our site where the UpdateElementSlugsAndUris is reporting a DivisionByZeroError. The issue is happening on this line:
$this->setProgress($queue, $this->_totalProcessed++ / $this->_totalToProcess);Looks like
$this->_totalToProcesscan sometimes be 0 while in theforeach (Db::each($query) as $element) {loopSteps to reproduce
Craft CMS version
4.13.8
PHP version
8.3.16
Operating system and version
No response
Database type and version
PostgreSQL 16.6
Image driver and version
No response
Installed plugins and versions