citizenlab
citizenlab copied to clipboard
TAN-666 Custom field not persisted bug
trafficstars
https://www.notion.so/citizenlab/Some-custom-field-values-do-not-get-persisted-0e2471aaf5c54b1cb42e2cd703be9538?pvs=4
This issue is that it was possible to duplicate existing fields. In this case, the description/body built-in field was duplicated, resulting in an html_multiloc extra field, which we didn't support. When such a field is added, the texts submitted by residents in the responses get lost.
3 measures were taken against this issue:
- Do not show the "Copy" option for built-in fields (frontend)
- Do not accept new fields with input_types that are not supported (backend)
- Fix the issue that we had with the html_multiloc type (backend -- see custom_fields_params_service.rb:14-15)
I also applied the camping rule: "Always leave the code base healthier than when you found it."
Changelog
Fixed
- [TAN-1666] Some custom field values could get lost when submitting inputs.
- [TAN-1666] Do not allow copying default fields.
Technical
- [TAN-1666] Support html_multiloc fields for inputs in the backend.
| Warnings | |
|---|---|
| :warning: | The PR title contains no Jira issue key (case-sensitive) |
| :warning: | The branch name contains no Jira issue key (case-sensitive) |
| Messages | |
|---|---|
| :book: | Changelog provided 🎉 |
| :book: | |
| :book: | Check translation progress |
Generated by :no_entry_sign: dangerJS against 179eca8caa62c3bf3eafebd31e1318faf1489758