Division by zero warning

Created on 25 May 2022, over 2 years ago
Updated 19 April 2024, 7 months ago

Problem/Motivation

Under certain conditions the following warning appears:

Warning: Division by zero in Drupal\\webform_counter\\Controller\\AjaxController->counter() (line 64 of /web/modules/contrib/webform_counter/src/Controller/AjaxController.php)

Steps to reproduce

Proposed resolution

Modify the:

web/modules/contrib/webform_counter/src/Controller/AjaxController.php
63: $target_count = $webform->getThirdPartySetting('webform_counter', 'target_submissions_count') ?: 0;
64: $percent = round(100 * $count / $target_count);

Remaining tasks

- Fix the warning

User interface changes

No

API changes

No

Data model changes

No

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇬🇷Greece dspachos

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024