Openfoodnetwork: Snail when creating enterprise fees, if Tax Category field is left blank

Created on 26 Nov 2020  路  6Comments  路  Source: openfoodfoundation/openfoodnetwork

Description


The user sees the snail if attempts to create an enterprise fee, but leaves Tax Category field blank.

Bugsnag
https://app.bugsnag.com/yaycode/openfoodnetwork-uk/errors/5fbf9367d4efc80018dca481?event_id=5fbf936700658d8755bb0000&i=sk&m=nw

I thought this bug could be related to these settings, but it seems to occur independently of what is chosen here:

image.png

And here (superadmin):

image.png

Expected Behavior

Currently (in master/production) it's possible to leave this info out, and still create the Fee.

Actual Behaviour

It's not possible to create a fee leaving Tax Category blank.

Steps to Reproduce




As admin

  1. Go to https://staging.openfoodnetwork.org.uk/admin/enterprise_fees
  2. Fill in Enterprise, Fee Type, Name and Calculator
  3. Click Update
  4. Boom.

Animated Gif/Screenshot


image.png

Workaround

Select Tax Category from the dropdown, and try again.

Severity

bug-s4: it's annoying, but you can use it

Your Environment

  • Version used: rails 4.2
  • Browser name and version: Firefox 83
  • Operating System and version (desktop or mobile): Desktop Ubuntu 20.04

Possible Fix

bug-s4 r4.2-regression

All 6 comments

I didn't even realise this was possible to begin with..? Does this work in master? I think in UK we have a "no tax" tax category, but you still have to select one.

We need an error message rather than a slug :pray:

Note: the Bugnsag error is NameError - wrong constant name...

I can't replicate this locally... I can always create the fee without error while that field is blank, regardless of tax settings (I tried switching them all around). The error in Bugsnag looks a bit odd, I think this might be a data inconsistency issue related to a bug we've seen recently in master. I'll have to investigate a bit more....

Hmmm... I just created 6 enterprise fees in a row on UK Staging as well, without setting the tax category field and couldn't create any snails.

I did rebase the branch the other day, maybe it was fixed at that point?

Oh, you're right... This was easily reproduced before but it's gone now.
Thanks for checking Matt.

I think we can close this issue here.

Not related to the rails upgrade:
I think there is some inconsistency in the way the banner is displayed. For example, creating a fee but leaving empty mandatory fields like Enterprise or Name and clicking Update displays this banner (below) but no fee is created:

image

This is a separate issue.

Was this page helpful?
0 / 5 - 0 ratings