Commit a2a14cd7 authored by Jacob Rockowitz's avatar Jacob Rockowitz Committed by Jacob Rockowitz
Browse files

Issue #3302341 by jrockowitz, sivamallareddy: Divide by zero when checked Show...

Issue #3302341 by jrockowitz, sivamallareddy: Divide by zero when checked Show Line progress percentage checkbox with PHP8
parent ab9fc23e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -558,7 +558,9 @@ function template_preprocess_webform_progress(array &$variables) {
  }

  if ($webform->getSetting('wizard_progress_percentage')) {
    $variables['percentage'] = number_format(($current_index / ($total - 1)) * 100, 0) . '%';
    $variables['percentage'] = ($total > 1)
      ? number_format(($current_index / ($total - 1)) * 100, 0) . '%'
      : '0%';
  }
}