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

fix(settings): Sort all settings - incl declarative settings - by priority #48424

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Sep 27, 2024

Summary

Previously declarative settings were sorted by priority but behind the "native" settings, this is now fixed, meaning a declarative setting with higher priority than an ISetting will be correctly rendered before that ISetting in the settings list.

Checklist

@susnux susnux added this to the Nextcloud 31 milestone Sep 27, 2024
@susnux susnux requested review from artonge, provokateurin, a team and icewind1991 and removed request for a team September 27, 2024 19:44
@susnux
Copy link
Contributor Author

susnux commented Sep 27, 2024

cc @SebastianKrupinski

private function formatSettings(array $settings, array $declarativeSettings): array {
$settings = array_merge($settings, $declarativeSettings);

usort($settings, function ($first, $second) {

Check notice

Code scanning / Psalm

MissingClosureReturnType Note

Closure does not have a return type, expecting mixed
provokateurin

This comment was marked as resolved.

…ority

Previously declarative settings were sorted by priority but behind the "native" settings,
this is now fixed, meaning a declarative setting with higher priority than an `ISetting` will
be correctly rendered before that `ISetting` in the settings list.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the fix/declarative-settings-priority branch from 63b4c5c to b525618 Compare September 28, 2024 12:08
Copy link
Contributor

@SebastianKrupinski SebastianKrupinski left a comment

Choose a reason for hiding this comment

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

Tested. Works great!

@susnux susnux merged commit a0b2297 into master Sep 28, 2024
173 checks passed
@susnux susnux deleted the fix/declarative-settings-priority branch September 28, 2024 17:45
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Declarative settings are always rendered last
3 participants