-
Notifications
You must be signed in to change notification settings - Fork 81
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
Website throws an errors when you delete the single contacts row and then submit #315
Comments
Which browser are you on? I can't reproduce it on Mac/Chrome. |
Linux/Firefox |
Are there any JavaScript errors logged? |
Just a couple of warnings, both "Empty string passed to getElementById()." when I click on the delete icon. Unfortunately, these are logged against JQuery and datatables so I'm not sure what is the empty string supposed to contain. Anyway, I actually get this warning on a lot of the interactive elements, such as whenever I click on the private-public widget on the project add details form. |
Here's more information on the error:
|
Tried it now with Linux/Chromium and I get the same error. But this time there are no JS warnings or errors on the console. |
I tried this on Chrome, Firefox, Safari on Mac, it works for both the Organization and the Project forms. @Cadasta/cadasta-dev Can someone please give this a try on different platforms/browsers? |
No issues on Firefox and Chrome on Windows. @seav could you make a screencast of what you are doing to make sure we are doing the same thing? |
Tried this on the following and was able to reproduce it:
|
In your screenshot you aren't adding an organization name. If I leave that blank then yes it creates and error, but I think it is a different one than deleting the contact info. |
I would expect that in my screenshot, I would just get the "This field is required" error message instead of a website error. It seems that the combination of the missing name and the deleted contact row results into the website error. There's probably a missing guard condition in the platform somewhere. |
So there are 2 conditions required to show the bug:
So here's a matrix of what happens depending on the conditions when the form is submitted.
|
Fixes #315 -- Set _errors when contact is removed
For the contacts sub-form in both the add organization and add project forms, the single contacts row has a delete contact icon to the right (circled below). Clicking on it, and then submitting the form results in an AttributeError being raised. This still happens even if you delete the row, and then click on "Add contact" afterwards to add back the single row. I think we should remove the delete contact icon when only 1 row is shown. Update: This error only occurs if the name field is left blank.
The text was updated successfully, but these errors were encountered: