Repository navigation
[3.0] Loads the permission profiles in the order they were made again - #9715
Merged
jdarwood007 merged 1 commit intoOct 4, 2026
Merged
jdarwood007 merged 1 commit into
jdarwood007 merged 1 commit into
Conversation
2.1 read them ORDER BY id_profile. PermissionProfile::loadAll() joins the boards as well, and lost the ORDER BY on the way, which left the order to the database. MySQL happens to return InnoDB rows in primary key order; PostgreSQL does not, so renaming a profile moved it to the bottom of every list and select of profiles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On PostgreSQL the permission profiles come out in no particular order: in the list under Permissions → Profiles, and in the profile and "copy from" selects on the board and profile pages.
2.1 loaded them
ORDER BY id_profile. In 3.0,PermissionProfile::loadAll()joins the boards so each profile knows which boards use it, and theORDER BYdid not survive the change. MySQL happens to return InnoDB rows in primary key order, so it still looked right there. PostgreSQL returns rows in the order they sit in the table, and anUPDATEwrites a row's new version at the end, so renaming a profile moves it to the bottom of every list.The query now orders by profile, and by board within a profile, so each profile's list of boards is in a stable order too.
Test
PermissionProfileTestrewrites the default profile's row, inside the transaction the integration suite rolls back, and checksloadAll()returns the profiles in id order. The rewrite is what makes PostgreSQL misorder them; on MySQL the test passes either way.loadAll()caches in a private static, which the test empties by reflection before and after. Without the change, on PostgreSQL:With it, it passes on both MySQL and PostgreSQL, and the rest of the integration suite is unaffected.
Found while building the template snapshot tests in #9712, where the profile lists came out in a different order on the two engines.
Issues References (Fixes|Related|Closes)
Related: #9712
🤖 Generated with Claude Code