Maybe not really a bug but an issue with our data and form fields that allow invalid info.
Many of our listings have incorrect URLs for Instagram, Twitter, etc. because volunteers are entering @username in the fields rather than the properly formatted full URLs that our system is expecting
Noting this as an issue so we don’t forget it and because devs may be able to help find and fix errors, or solve a different way.
What we need to do
We need to clean these up, and prevent it from happening in the future.
Possible solutions
Some possible solutions:
Fix our existing data — going through each of our listings and confirming and correcting the fields
This could be a volunteer task and people check and correct these manually (we have about 500 listings total to review, but no easy to use UI to do the review)
Or, perhaps, we could write and run scripts to turn usernames into full URLs
We could allow usernames and URLs both, and the website parses the field and displays the full URL appropriately
We could make all fields usernames-only and run a script to replace URLs with usernames in database, then display the full URL on the website
We should also display errors when field is incorrectly formatted to help data validators enter fields correctly
2130 — Indicate an error when there’s an invalid URL in these fields — perhaps “Needs to be a full URL e.g. http…" (or explicitly support and validate usernames (i.e. remove the @ if needed))
and (optionally) prevent approval (and display error message) if these aren’t valid URLs
Describe the bug
Maybe not really a bug but an issue with our data and form fields that allow invalid info.
Many of our listings have incorrect URLs for Instagram, Twitter, etc. because volunteers are entering @username in the fields rather than the properly formatted full URLs that our system is expecting
Noting this as an issue so we don’t forget it and because devs may be able to help find and fix errors, or solve a different way.
What we need to do
We need to clean these up, and prevent it from happening in the future.
Possible solutions
Some possible solutions:
Fix our existing data — going through each of our listings and confirming and correcting the fields
We could allow usernames and URLs both, and the website parses the field and displays the full URL appropriately
We could make all fields usernames-only and run a script to replace URLs with usernames in database, then display the full URL on the website
We should also display errors when field is incorrectly formatted to help data validators enter fields correctly
2130 — Indicate an error when there’s an invalid URL in these fields — perhaps “Needs to be a full URL e.g. http…" (or explicitly support and validate usernames (i.e. remove the @ if needed))
and (optionally) prevent approval (and display error message) if these aren’t valid URLs
How to recreate
For example, go to this organization (unless it’s been fixed since this bug report): https://foodoasis.la/organizations?latitude=34.081648&longitude=-117.740882&org=god%27s_pantry_-_pomona&id=4772
In the database: <img width="838" alt="image" src="https://github.com/hackforla/food-oasis/assets/3376957/45ded83d-f8aa-490b-af7d-8555a6c5bd10”>
Our web site - Instagram icon has malformed URL (it should be going to Instagram.com/godspantry_org) Video: https://github.com/hackforla/food-oasis/assets/3376957/f7a8a5c2-9397-4b8a-8f1e-a186fdf0de58