openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.1k stars 717 forks source link

Shipping or payment method disappears from the list if you de-activate #4837

Open RachL opened 4 years ago

RachL commented 4 years ago

Description

We currently have a checkbox that enables a hub to de-activate a shipping or payment method.

When a hub has only one shop, de-selecting this checkbox will make the method disappear from the list of methods for this hub. This means that they are re-creating needed shipping or payment method each time they de-activate them.

For some hub in France this means recreating a shipping method once a month....

When you have several shops, the shipping method remains active on the other shops, so still in the list.

The hub should see de-activated shipping or payments methods, even if the hub has only one shop.

Steps to Reproduce

  1. Create an account with only one hub
  2. Create 2 shipping methods
  3. Deactivate one of the shipping method
  4. Notice you are left with only one shipping method on your list
  5. Logout and log back in as a super admin, notice the shipping method is still there, just invisible for the hub.

Same for payment methods

Scenario with multiple hubs for payment method:

  1. Set up a payment method for several shops
  2. De-activate it thanks to:

image

  1. 💥 no more payment method an all your shops and no way to get it back, the list of payment method is empty

Animated Gif/Screenshot

Example of duplicate for hub ID 922:

image

Workaround

Recreate the shipping method.

Severity

bug-s3: a feature is broken but there is a workaround

Your Environment

Possible Fix

gao329700254 commented 4 years ago

@RachL I created 2 shipping methods and deactivated one of them in an admin account with only one hub. I can still find the deactivated method in /admin/enterprises/:enterprise_name/edit#/shipping_methods. Could you please tell me which page the method disappeared?

Env:

RachL commented 4 years ago

@gao329700254 hello! You are on the right page but I suspect you are looking at the page with super admin rights. When you are a manager of a single enterprise, you won't see the shipping method on this page anymore. Currently as a super admin I'm re-activating the shipping method of my single-enterprise managers each week because of this :'(

Matt-Yorkley commented 4 years ago

Yep, your user in development should have the admin role. You can do this:

You should then see that the page behaves as described

RachL commented 4 years ago

I've updated the issue description because I've noticed that it can happen for users with payment method shared across several shops.

drummer83 commented 2 years ago

Just a note: I can confirm that the bug described in steps 1 to 5 is still present in v4.1.10. BUT: I was not able to recreate the bug for multiple hubs (steps 1 to 3). I tried with two hubs and the payment methods are still shown in the list (shown on the right), even when deactivated (shown on the left). Or maybe I got the scenario wrong... Bildschirmfoto vom 2021-12-16 00-35-26

Interesting to mention that the method is set to "not active" but in the lists on the right it is shown as "active". Is this a bug or is the "active" on the right more an "assigned to" and the "active" on the left is for really deactivating the method?