Closed mm21 closed 1 year ago
For some background, these relations are created via ETAPI and can be created out of order, which I think is what's causing this.
Did some digging and can confirm that values of promoted attributes are showing in the order in which they're created, not their position, even after restarting frontend and backend. It reproduces in the UI for me as well.
From looking at the code, I think FNote.getOwnedAttributes() is not taking position into account while FNote.getAttributes() is.
Edit: and this indeed applies to labels too, it was just a coincidence that I was creating the labels in the right order.
Actually not even getAttributes() has guaranteed sorting. The position order of attributes is mostly important for UI in a few places and thus the data model does not keep them sorted.
So this fixes it in the promoted attributes UI.
Makes sense. Thanks for the background and quick fix!
Trilium Version
next61 (f8c9178)
What operating system are you using?
Ubuntu
What is your setup?
Server access only
Operating System Version
Ubuntu 22.04 LTS
Description
The order of promoted relations:
Doesn't follow the actual attribute order:
But promoted labels seem to be ordered fine.This applies to labels too.Error logs
No response