Applying the patch from #44406 fails with CRLF line endings
Added by Florian Walchshofer 2 days ago
Hi Maik Rohde,
let's continue here instead of the issue. Feature #44406: Persist manually adjusted sort order in tables that belong to self-designed queries
Your output helps: the patch is fine, but the Redmine files on your server have Windows line endings (CRLF), probably from copying or unpacking them via Windows. You can check it with file app/controllers/issues_controller.rb ("with CRLF line terminators").
This applies the patch anyway (in /redmine/redmine-7.0.0):
git apply --ignore-whitespace --check 0001-Keep-the-sort-order-of-a-saved-query-in-the-session-.patch git apply --ignore-whitespace 0001-Keep-the-sort-order-of-a-saved-query-in-the-session-.patch
If the first command prints nothing, run the second one and restart Redmine. To undo it: git apply -R --ignore-whitespace 0001-Keep-the-sort-order-of-a-saved-query-in-the-session-.patch
No need to edit anything in nano.
Replies (3)
RE: Applying the patch from #44406 fails with CRLF line endings
-
Added by Maik Rohde 1 day ago
Hi Florian,
This does the trick. Patch successfully applied. Thanks for your patience with me.
I can confirm, that the sort order now is being kept when I stay in the current query and just switch tabs.
But you got my colleague's point already right 3 days ago. They need indeed the sort order to be kept when switching between queries as well. This is actually the quintessential point, as a ticket passes up to 10 different queries until it's finally done.
So It'd be great if you could provide this behaviour.
For me it'd be perfectly okay if you provide yet another patch, as I now know how to handle it properly.
Thanks a lot in advance!
Best,
Maik
RE: Applying the patch from #44406 fails with CRLF line endings
-
Added by Florian Walchshofer 1 day ago
Hi Maik,
great to hear that the patch works now!
About keeping the sort order when switching between queries: I'm not in favour of such a change in Redmine core. Selecting a saved query should always apply the sort order defined in that query. That's what a saved query is for, and other users rely on this behaviour.
This is more something for a plugin. I'll have a look at it in the next few days and get back to you here.
In the meantime, it would be great if you could confirm the behaviour of the current patch directly in #44406 (sort order is kept when staying in the same query and switching tabs). Feedback from real users helps a lot to get it into core, and I'm in favour of having that part implemented there.
Best regards,
Florian
RE: Applying the patch from #44406 fails with CRLF line endings
-
Added by Florian Walchshofer about 23 hours ago
Hi Maik,
I have attached a second patch to #44406#note-7:
It adds an option to saved queries: "Keep the current sort order when selecting this query". For queries with this option, the sort order is kept when switching to them. As it is an option per query, it fits different users and workflows: your colleague can keep the sort order across the queries an issue passes through, while queries without the option still apply their own sort order.
You can apply it the same way as the first patch, on top of it