Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make allergens and traces values supplied by producers completely replace existing values #8522

Closed
stephanegigandet opened this issue Jun 6, 2023 · 2 comments · Fixed by #8538
Labels
🥜 Allergens 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Jun 6, 2023

The usual behaviour for "tags" fields such as categories, labels, countries, allergens etc. is that values supplied by producers are added to any existing value entered by users (e.g. producers might sent us only the "Organic" label while we may have more precise labels and mentions such as "AB Organic" or "Rich in fiber").

For allergens and traces though, if the producer sends a value, we can assume that the value is complete, and that it can replace entirely any pre-existing value.

We need to do 2 things:

  1. On the pro platform, when importing allergens and traces, if the producers supplies a value (non empty), then we replace existing values.
  2. When exporting data from the pro platform and importing it to the public platform, if there is a non empty value for allergens, we replace existing values.

Related to #7850

Part of

@stephanegigandet stephanegigandet added 🥜 Allergens 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers labels Jun 6, 2023
@MonalikaPatnaik
Copy link
Collaborator

MonalikaPatnaik commented Jun 6, 2023

Working on this!
Could you pls tell me the relevant code file to make desired changes :')

@stephanegigandet
Copy link
Contributor Author

Related code:
probably in lib/ProductOpener/Import.pm
there are test files t/integration/import_csv_file.t

fields that should be protected should be configured in Config_off.pm, at the beginning it will be allergens and traces, but we might add other fields later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🥜 Allergens 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers
Projects
Status: Done
2 participants