openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
657 stars 385 forks source link

Weird API behaviour for langcode spotted in the Power User Script #3981

Open teolemon opened 4 years ago

teolemon commented 4 years ago

image https://world.openfoodfacts.org/api/v0/product/7610200306777.json "languages_codes":{"de":2,"it":2,"fr":4} On the same page: image https://world.openfoodfacts.org/product/8428764100163/germinados-de-alfalfa-tarrina-fanya https://world.openfoodfacts.org/api/v0/product/8428764100163.json Nothing

stephanegigandet commented 4 years ago

@teolemon : can you be more specific to what the bug is? I don't understand what I'm supposed to see from the screenshots and links

svensven commented 4 years ago

In the first image, the ingredients don't match the records, probably because there was a delay between loading the page and going into list edit mode, during which time the search results had changed. (the PUS should probably load the ingredients based on the product ids rather than running the same search and hoping nothing has changed.)

The "{lang: de}" is actually from the record data, not the PUS. See the lang field in https://world.openfoodfacts.org/api/v0/product/8008698005880.json?rev=30

I'm guessing the issue with the 2nd image is that the language codes match the ingredients, not the products, again because the whole result set is offset by 1?

github-actions[bot] commented 8 months ago

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts