Skip to content

Conversation

@AgarFu
Copy link

@AgarFu AgarFu commented Sep 11, 2016

If the attribute to update is a hash and it is nill, then the wrong
attributes are being updated.

I found this bug while I was updating the assignee in an issue without
assignee. In that case, with this code:

issue.save!('fields' => { 'assignee' => user.attrs }) if issue.assignee.nil?

All the attributes of the user are being set to the issue,
for instance the issue.id becomes user.id, etc ...

This patch solves the issue and pases all the tests.

If the attribute to update is a hash and it is nill, then the wrong
attributes are being updated.

I found this bug while I was updating the assignee in an issue without
assignee. In that case, with this code:

issue.save!('fields' => { 'assignee' => user.attrs }) if issue.assignee.nil?

in this case, all the attributes of the user are being set to the issue,
for instance the issue.id becomes user.id, etc ...

This patch solves the issue and pases all the tests.
@bobbrodie bobbrodie added in progress Bug Broken functionality labels Nov 13, 2016
@SimonMiaou
Copy link
Contributor

@AgarFu Could you add a test so we can merge it?

@SimonMiaou SimonMiaou self-assigned this Jul 21, 2017
@SimonMiaou
Copy link
Contributor

@AgarFu Hey, I merge develop and solve the conflict.
I'd like to merge this PR this week as it is blocking some user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Broken functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants