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

Check if adminSoertIndex key exists #736

Merged
merged 1 commit into from
Feb 13, 2018

Conversation

Leone
Copy link
Contributor

@Leone Leone commented Feb 8, 2018

Issue: #729

This one fix the missing adminSortIndex issue.
If you change the option label in the filter attribute in the admin panel, the script doesn't see this option, doesn't set key adminSortIndex and throws an error in usort() function.

This issue exists in all versions.

Regards,
Grzegorz

@afoucret afoucret changed the base branch from master to 2.5.x February 9, 2018 09:04
@afoucret afoucret changed the base branch from 2.5.x to master February 9, 2018 09:04
@afoucret
Copy link
Contributor

afoucret commented Feb 9, 2018

Hi @Leone,

I think it would be nice to release this patch in the 2.5.1 release since the next major release (2.6.0) is not coming before 2 months.

Could you rebase this PR from branch 2.5.x, please ?

@Leone Leone force-pushed the fix_missing-adminSortIndex-key branch from e110233 to 28b8a48 Compare February 9, 2018 12:41
@Leone
Copy link
Contributor Author

Leone commented Feb 9, 2018

Hi @afoucret,

I rebased pull request from branch 2.5.x.
Please keep in mind that in previous versions this problem was also present.

@afoucret afoucret changed the base branch from master to 2.5.x February 9, 2018 12:54
@afoucret afoucret merged commit a1fd0e3 into Smile-SA:2.5.x Feb 13, 2018
@afoucret afoucret added the bug label Feb 13, 2018
@afoucret
Copy link
Contributor

Hi @Leone,

I have merged it in the branch 2.5.x and it will be part of the next maintenance release (2.5.x).
Our maintenance policy is to apply this kind of non-security patch only on the latest release.

Thx for contributing,

return 0;
}

return $item1['adminSortIndex'] <= $item2['adminSortIndex'] ? -1 : 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this can be replaced with single line:

return $item1['adminSortIndex'] ?? 0 <=> $item2['adminSortIndex'] ?? 0;

@Leone Leone deleted the fix_missing-adminSortIndex-key branch September 13, 2018 05:59
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 this pull request may close these issues.

3 participants