Try to edit the options of a custom profile field with type select.
Click the delete button on an option named example_option.
Write example_option1 in the new option textbox and you will notice that there is no confirmation dialog to delete the example_option value.
The above happens because data-value is changed by read_select_field_data_from_form when we have typed example_option in the new input box because it matches with an old value. Making any changes to that input box will not change the data-value and thus no delete confirmation dialog. Previously before #29813, read_select_field_data_from_form was only called before submit, but now it is called after any field is changed.
Bug 2:
Add an option with the same value as an existing option.
Click on save changes.
The changes will be saved successfully without giving an error for duplicate choices.
If an option is renamed, it's safest to remove it from users' profiles. Otherwise, there's a risk that it will look like they chose something they didn't. Previously, if a user deleted an option and then filled the same text in a new option, we assumed it was the same option behind the scenes. We will not do that anymore.
So, this bug will not be directly solved, but solved implicitly by the above change since the underlying code for the bug will cease to exist
Bug 1:
example_option
.example_option1
in the new option textbox and you will notice that there is no confirmation dialog to delete theexample_option
value.The above happens because
data-value
is changed byread_select_field_data_from_form
when we have typedexample_option
in the new input box because it matches with an old value. Making any changes to that input box will not change thedata-value
and thus no delete confirmation dialog. Previously before #29813,read_select_field_data_from_form
was only called before submit, but now it is called after any field is changed.Bug 2:
Solution:
From https://github.com/zulip/zulip/pull/29880#issuecomment-2092362778.
If an option is renamed, it's safest to remove it from users' profiles. Otherwise, there's a risk that it will look like they chose something they didn't. Previously, if a user deleted an option and then filled the same text in a new option, we assumed it was the same option behind the scenes. We will not do that anymore.
So, this bug will not be directly solved, but solved implicitly by the above change since the underlying code for the bug will cease to exist
Zulip Server and web app version: