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

Prevent people from entering email addresses as values #6539

Closed
Tracked by #10272
teolemon opened this issue Apr 1, 2022 · 7 comments · Fixed by #8452 · May be fixed by #6655
Closed
Tracked by #10272

Prevent people from entering email addresses as values #6539

teolemon opened this issue Apr 1, 2022 · 7 comments · Fixed by #8452 · May be fixed by #6655
Assignees
Labels
🧽 Data quality https://wiki.openfoodfacts.org/Quality ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ⭐ top issue Top issue.

Comments

@teolemon
Copy link
Member

teolemon commented Apr 1, 2022

What

  • Prevent people from entering email addresses as values

Screenshots

Capture d’écran 2022-04-01 à 18 27 54

Part of

@teolemon teolemon added the 🧽 Data quality https://wiki.openfoodfacts.org/Quality label Apr 1, 2022
@stephanegigandet
Copy link
Contributor

Files with the corresponding code:

Server-side:

cgi/product_multilingual.pl - web form to edit products
cgi/product_jqm_multilingual.pl - API
lib/ProductOpener/Products.pm

@yuktea
Copy link
Contributor

yuktea commented Apr 5, 2022

working on this!

@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2022

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jul 6, 2022
@github-actions github-actions bot added the ⭐ top issue Top issue. label Nov 19, 2022
@yuktea yuktea assigned yuktea and unassigned yuktea May 18, 2023
@MonalikaPatnaik
Copy link
Collaborator

I would like to work on this!

@yuktea yuktea assigned MonalikaPatnaik and unassigned yuktea May 18, 2023
@alexgarel
Copy link
Member

Relevant comment from old PR:

This would work, but as you suggest, we probably should think more about this, to decide what would be the right behaviour:

1. reject the changes completely if there is an error in one of the fields

2. ignore the fields that have errors

And how to convey this information to users so that they can correct the fields.

It's also complexified a bit by the fact that those changes can be made through the OFF website (and app), but also through third parties that use our API to add / edit products. It's relatively easy for us to introduce new behaviours on the website (such as redisplaying the form with messages about errors), but for the API, we need to find a solution that does not break existing applications that use the API.

@alexgarel
Copy link
Member

My proposal to keep things simple (as a first iteration):

  • just remove values that are email in fields and accept the rest of the edit (for single valued fields remove the field edit, for multi-valued fields just remove entries that are emails)
  • on the web application add a warning thanks to javascript

That way we can do it in process_product_edit_rules (but in a separate method, it's already big).

(in fact process_product_edit_rules could be renamed to check_product_edit, that call both methods and still return a boolean).

@MonalikaPatnaik
Copy link
Collaborator

My proposal to keep things simple (as a first iteration):

  • just remove values that are email in fields and accept the rest of the edit (for single valued fields remove the field edit, for multi-valued fields just remove entries that are emails)
  • on the web application add a warning thanks to javascript

That way we can do it in process_product_edit_rules (but in a separate method, it's already big).

(in fact process_product_edit_rules could be renamed to check_product_edit, that call both methods and still return a boolean).

Working on this..will resolve it soon!
Thanyouu :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧽 Data quality https://wiki.openfoodfacts.org/Quality ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ⭐ top issue Top issue.
Projects
5 participants