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
Editing a product with additional nutrients will erroneously change the recorded values of these nutrients on save #4145
Comments
More info: it happens only when selecting mg or ug |
I inputed 10 mg and this is the result. Should we take the _value? |
Is this a sever side or client side issue @VaiTon ? |
_value and _unit are internal data, they should not be read by the app. Use the _100g field instead. It is always in grams. |
@stephanegigandet we need to use the _unit to set the unit spinner in the app. Otherwise what abount taking the value in 100g and then finding the most appropriate unit? |
That's the best thing to do. |
ref: use extension functions to query db Closes #4145
* fix: refactored measurements inner working * ref: use extension functions to query db Closes #4145 Co-authored-by: naivekook <tanakov.dev@gmail.com>
Ok, so my edits do not seem taken into account |
Describe the bug
When editing a product with additional nutrients recorded (eg Vitamin D), the additional Nutrient values will be changed on save (even when not edited),
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The nutrient value do not get changed.
Actual behaviour
The nutrient value is divided by 1000.
Example
See my edits on the product https://world.openfoodfacts.org/product/4001497280001/ :
**
Vitamin C (ascorbic acid) | 35 mg
**
Vitamin C (ascorbic acid) | 0.035 mg
**
Vitamin C (ascorbic acid) | 0 mg |
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: