Actions
Bug #10550
closedSettings API updates value even if value parameter isn't supplied
Description
When making a PUT to /api/v2/settings/name with an empty hash, the value is changed. Since #10402 this will change booleans to false, prior to that you might get an error about downcase!.
GET "/api/v2/settings/Parametrized_Classes_in_ENC"
value is true
Now update:
2015-05-19 16:30:54 [I] Started PUT "/api/v2/settings/Parametrized_Classes_in_ENC" for 127.0.0.1 at 2015-05-19 16:30:54 +0100
2015-05-19 16:30:54 [I] Processing by Api::V2::SettingsController#update as JSON
2015-05-19 16:30:54 [I] Parameters: {"setting"=>{}, "apiv"=>"v2", "id"=>"Parametrized_Classes_in_ENC"}
2015-05-19 16:30:54 [D] (0.1ms) UPDATE "settings" SET "value" = '--- false
...
', "updated_at" = '2015-05-19 15:30:54.787404' WHERE "settings"."category" IN ('Setting::Puppet') AND "settings"."id" = 28
And the value has been changed to false.
https://github.com/theforeman/foreman/blob/1.8.0/app/controllers/api/v2/settings_controller.rb#L27 is updating the value without changing that params even contains a value.
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2556 added
- Pull request deleted (
)
Updated by Ondřej Pražák over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset ee464a8e1f60a70d71a0d09b96d0b4d37372e499.
Updated by Dominic Cleal over 9 years ago
- Assignee set to Ondřej Pražák
- Translation missing: en.field_release set to 63
Actions