[API] data loss caused by changed behaviour of custom user_field update

For example I have configured two custom user_fields: 1 and 2
Executing the following request to update custom user_field 2 clears the content of the custom user_field 1:
curl -X PUT -d 'user_fields[2]=Lorem ipsum' http://discourse.example.com/users/john-doe.json?api_key=test_d7fd0429940&api_username=test_user

In the past this request only changed the content of custom user_field 2 and the content of custom user_field 1 was unchanged.

Was this change of the custom user_fields update intentional?
Tested with Discourse version 1.8.10

Added pull request with tests for this bug: https://github.com/discourse/discourse/pull/5438

3 Likes

Fixed in

https://github.com/discourse/discourse/commit/6a2bce19317b05f1eab56f82ced58a248db90d94

Thank you @PhALDan.test for providing the test case.

6 Likes

This topic was automatically closed after 5 days. New replies are no longer allowed.