Avoid dividing by zero on order items report

Created on 7 November 2022, about 2 years ago
Updated 13 October 2023, about 1 year ago

Problem/Motivation

If we have an order item costing 0, or in fact having amount 0, for different reasons, generating an order item report will fail.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇳🇴Norway eiriksm Norway

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.

  • 🇮🇱Israel jsacksick

    hm... Shouldn't we fix this in a cleaner way? This happens only if the quantity is 0 no? So perhaps we should just check that? I don't really like the @ prefix and there shouldn't be a need for a try catch block.

  • 🇩🇪Germany Anybody Porta Westfalica

    Agree with #3 hiding an error entirely like this is bad:

    +      catch (\Throwable $e) {
    +      }

    Instead solve the underlying problem or log it, if it needs to be fixed manually.

  • 🇮🇳India SandeepSingh199

    For now added a logger in catch block. I am also looking into this issue.

Production build 0.71.5 2024