-
Notifications
You must be signed in to change notification settings - Fork 143
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
Fix for issue preventing validation of url with only whitespace #11549
base: dev/7.6.x
Are you sure you want to change the base?
Fix for issue preventing validation of url with only whitespace #11549
Conversation
This has been targeted at 7.6.x (rather than 8.0.x) because it was recently raised from an AfHER context, causing a semi-data loss state, as the entire tile needs to be deleted in order to update a URL. If the nodegroup held a small set of nodes then it wouldn't be as major, but due to the number of nodes in some of the AfHER nodegroups (e.g. External Cross References, or some Monument/Area Phases) it means that a lot of data must be deleted and re-inputted. Since AfHER will be on 7.6.x soon (and for a long period of time), it'd be great to get semi-data loss scenarios like this into 7.6. |
I've noticed that this fix doesn't set the node value to null if there is no data, instead it looks as such:
We need to the data to appear as null in the backend, but still editable in the front end. This issue is related to this recent string issue #11658 as they both concern the back-end having a null value but the front-end either not reflecting this. |
I just tried to reproduce the bug that this ticket addresses #10796, but I couldn't reproduce the issue given the instructions in the ticket. It seems like it addresses a different problem. Maybe a different issue is needed? |
I can reproduce it in 7.6, but only with a newly created URL. Once I refresh the page and try to edit it further times the issue doesn't occur (shown below). URL_saving_issue_76.mp4The second input that doesn't trigger a dirty state will have it's value persist in the node preview, while being constantly removed from the input box (this is after going to and from different nodegroups) It's odd how this issue occurs after the inital saving of the value when it is null, but after refreshing the page data can be added and reverted to null with no problems. |
Types of changes
Description of Change
Previously, the clean function was assigning
tile.data[nodeid]
as None if the url provided was entirely whitespace, which prevented it from being validated. This then prevented further data entry after saving.The clean function now separates out some of the logic, so that the url_label is replaced with None if blank or whitespace, but the full
tile.data[nodeid]
is only assigned as None if both values are falsey. This means that blank but non-empty url strings still go through to validation.Issues Solved
Closes #10796
Checklist
Accessibility Checklist
Developer Guide
Ticket Background
Further comments