Groups and subgroups filtering uses regular expressions. The filter looks like "^" + name + "$" The problem is that the special characters in group/subgroup name are not properly escaped, which means that if a name contains "+", "*", or any other regexp special characters, filtering will probably fail. Another (minor) problem is that we use the name to filter instead of the code. So if we have two groups or two subgroups with the same name, it will show reports from both groups/subgroups. There is no reason to have groups/subgroups with the same name, but it is possible (whereas it's not possible to have different groups/subgroups with the same code), so this should be fixed too.
Created attachment 161645 [details] [review] Bug 35943: Fix group/subgroup filtering of saved reports Use code instead of name for filtering and escape regexp special characters. This patch also disables datatables' smart filtering as it is not recommended to use with regexp filtering https://datatables.net/reference/api/search() Test plan: 1. Create a report in a group named "Foo + Bar" and in a subgroup named "Baz + Quux" 2. Create other reports in group "Foo + Bar" but in other subgroups, as well as in other groups. This is useful to see the effect of filtering 3. Go to the saved reports page and verify that navigating between tabs have the desired result. Same for the subgroup select
Created attachment 161793 [details] [review] Bug 35943: Fix group/subgroup filtering of saved reports Use code instead of name for filtering and escape regexp special characters. This patch also disables datatables' smart filtering as it is not recommended to use with regexp filtering https://datatables.net/reference/api/search() Test plan: 1. Create a report in a group named "Foo + Bar" and in a subgroup named "Baz + Quux" 2. Create other reports in group "Foo + Bar" but in other subgroups, as well as in other groups. This is useful to see the effect of filtering 3. Go to the saved reports page and verify that navigating between tabs have the desired result. Same for the subgroup select Signed-off-by: David Nind <david@davidnind.com>
Created attachment 163694 [details] [review] Bug 35943: Fix group/subgroup filtering of saved reports Use code instead of name for filtering and escape regexp special characters. This patch also disables datatables' smart filtering as it is not recommended to use with regexp filtering https://datatables.net/reference/api/search() Test plan: 1. Create a report in a group named "Foo + Bar" and in a subgroup named "Baz + Quux" 2. Create other reports in group "Foo + Bar" but in other subgroups, as well as in other groups. This is useful to see the effect of filtering 3. Go to the saved reports page and verify that navigating between tabs have the desired result. Same for the subgroup select Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12