Skip to content
This repository was archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2448 from ec-europa/division-by-zero
Browse files Browse the repository at this point in the history
Fix division by zero error in deploy hook
  • Loading branch information
idimopoulos authored Apr 13, 2021
2 parents 776f52c + 7231db8 commit 5388df0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/modules/custom/joinup_core/joinup_core.deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function joinup_core_deploy_0107001(array &$sandbox): string {
}

$sandbox['progress'] += count($entity_ids);
$sandbox['#finished'] = (float) $sandbox['progress'] / (float) $sandbox['max'];
$sandbox['#finished'] = empty($sandbox['entity_ids']) ? 1 : (float) $sandbox['progress'] / (float) $sandbox['max'];

return "Completed {$sandbox['progress']} out of {$sandbox['max']}.";
}

0 comments on commit 5388df0

Please sign in to comment.