Koha-clms/reports
Slava Shishkin 0d80c7d440
Bug 43296: Support valid patron attribute codes in circulation stats
Circulation statistics only recognise numeric patron attribute codes,
while patron attribute type codes are not restricted to numbers.

Validate Row, Column and Filter_borrower_attributes against the available
patron attribute types. Use generated SQL aliases and pass attribute
codes as bind parameters.

Test plan:
1. In Administration > Patron attribute types, create attribute types with codes
   SHOW-BCODE, SHOW.BCODE, SHOW BCODE and SQL); DROP TABLE borrowers; --..
2. Go to Reports > Statistics wizards > Circulation.
3. Use each attribute as Row and Column with an ordinary field on the other axis.
4. Confirm the report fails or uses the wrong field.

Apply the patch.
5. Restart Plack.
6. Repeat steps 3-4.
7. Confirm the reports succeed and use the selected patron attribute.
8. Test the same attributes as filters.
9. Confirm ordinary Row, Column and Filter fields still work.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-09-09 15:49:58 +00:00
..
acquisitions_stats.pl Bug 42360: Move separator validation to C4::Context::csv_delimiter 2026-07-13 15:46:31 +00:00
bor_issues_top.pl Bug 42369: Use C4::Context::csv_delimiter for delimiter validation 2026-07-13 15:46:37 +00:00
borrowers_out.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
borrowers_stats.pl Bug 40287: Fix untranslatable strings in more statistics wizards 2025-12-17 13:24:31 -07:00
cash_register_stats.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
cat_issues_top.pl Bug 42736: Prevent SQL injection in reports/cat_issues_top.pl 2026-08-26 09:23:29 +00:00
catalog_by_itemtype.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
catalogue_out.pl Bug 42803: Only perform the lookups when !$filter is true 2026-06-19 15:39:00 +00:00
catalogue_stats.pl Bug 42363: Use C4::Context::csv_delimiter for delimiter validation 2026-07-13 15:46:33 +00:00
dictionary.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
guided_reports.pl Bug 16631: Bring back template. Fix test syntax. 2026-07-28 14:32:27 +00:00
issues_avg_stats.pl Bug 42368: Use C4::Context::csv_delimiter for delimiter validation 2026-07-13 15:46:35 +00:00
issues_stats.pl Bug 43296: Support valid patron attribute codes in circulation stats 2026-09-09 15:49:58 +00:00
itemslost.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
orders_by_fund.pl Bug 40163: (follow-up) Fix wrong GNU links and update test 2025-09-24 09:25:04 -06:00
reports-home.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
reserves_stats.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00
serials_stats.pl Bug 40163: Fix several http addresses in the code docs 2025-09-23 16:21:29 -06:00