Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-associative array values in AR aren't considered different #19872

Closed
kyliemsauter opened this issue Jun 29, 2023 · 3 comments · Fixed by #19915
Closed

Non-associative array values in AR aren't considered different #19872

kyliemsauter opened this issue Jun 29, 2023 · 3 comments · Fixed by #19915
Labels
Milestone

Comments

@kyliemsauter
Copy link

I think there's a still a bug with this, isValueDifferent() is sorting the arrays if they aren't associative when it's supposed to be sorting them when they ARE associative.

if (is_array($newValue) && is_array($oldValue) && !ArrayHelper::isAssociative($oldValue)) {

Originally posted by @kyliemsauter in #19743 (comment)

@samdark samdark added the type:bug Bug label Jun 30, 2023
@samdark
Copy link
Member

samdark commented Jun 30, 2023

Doesn't look right. Do you have time for a pull request with unit tests (so it doesn't break again ever) and a fix?

@eegusakov
Copy link
Contributor

Hi! I would like to fix it

eegusakov added a commit to eegusakov/yii2 that referenced this issue Jul 26, 2023
…perties for a non-associative array in case of changing the order of elements
samdark pushed a commit that referenced this issue Aug 18, 2023
… for a non-associative array in case of changing the order of elements
@samdark samdark added this to the 2.0.49 milestone Aug 18, 2023
@olegbaturin
Copy link
Contributor

isValueDifferent not works for arrays like

['', 0, ''],
['', '', 0],

values are considered as equal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants