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

Fix division by zero error in deploy hook #2448

Merged
merged 1 commit into from
Apr 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']}.";
}