citizenlab icon indicating copy to clipboard operation
citizenlab copied to clipboard

TAN-666 Custom field not persisted bug

Open sebastienhoorens opened this issue 1 year ago • 3 comments
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:

  1. Do not show the "Copy" option for built-in fields (frontend)
  2. Do not accept new fields with input_types that are not supported (backend)
  3. 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.

sebastienhoorens avatar May 07 '24 14:05 sebastienhoorens

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:

Run the e2e tests

:book: Check translation progress

Generated by :no_entry_sign: dangerJS against 179eca8caa62c3bf3eafebd31e1318faf1489758

cl-dev-bot avatar May 07 '24 14:05 cl-dev-bot