Bug 31158

Summary: Can't filter suggestions by date ranges
Product: Koha Reporter: Owen Leonard <oleonard>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: jonathan.druart, lucas, martin.renvoize, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on: 23991    
Bug Blocks:    
Attachments: Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates
Bug 30879: DBRev 22.06.00.031
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates

Description Owen Leonard 2022-07-14 18:58:13 UTC
On the suggestions home page I expanded the "Suggestions information" sidebar filter, then entered dates in the "Suggested date from:" and "To:" fields.

When I submit I get an error:

DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'suggesteddate_from' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 394
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
Comment 1 Katrin Fischer 2022-07-15 09:12:35 UTC
Confirmed!

It cannot work, the column in the database is suggesteddate. But this problem exists for all the data range searches in the form.
Comment 2 Jonathan Druart 2022-08-01 06:16:37 UTC
Created attachment 138436 [details] [review]
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates

Search suggestions by date is broken, we don't remove the '_from' CGI
params for the DBIC query
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'suggesteddate_from' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 394
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

Test plan:
Create some suggestions, search for them using date range (suggested
date, managed date and accepted date)
Comment 3 Rachael 2022-08-02 20:13:51 UTC
Created attachment 138519 [details] [review]
Bug 30879: DBRev 22.06.00.031

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Rachael Laritz <rachael.laritz@inlibro.com>
Comment 4 Jonathan Druart 2022-08-04 12:21:35 UTC
Rachael, were you signed off on purpose?
The process you followed is not correct, please read https://wiki.koha-community.org/wiki/Sign_off_on_patches
You didn't attach the correct patch to the bug report.
Comment 5 Katrin Fischer 2022-08-07 22:02:37 UTC
Created attachment 138762 [details] [review]
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates

Search suggestions by date is broken, we don't remove the '_from' CGI
params for the DBIC query
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'suggesteddate_from' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 394
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

Test plan:
Create some suggestions, search for them using date range (suggested
date, managed date and accepted date)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Martin Renvoize 2022-08-09 16:20:19 UTC
Created attachment 138930 [details] [review]
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates

Search suggestions by date is broken, we don't remove the '_from' CGI
params for the DBIC query
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'suggesteddate_from' in 'where clause' at /kohadevbox/koha/Koha/Objects.pm line 394
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77

Test plan:
Create some suggestions, search for them using date range (suggested
date, managed date and accepted date)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-08-09 16:20:37 UTC
Solid fix, works as expected.. Passing QA
Comment 8 Victor Grousset/tuxayo 2022-08-11 23:51:49 UTC
*** Bug 31347 has been marked as a duplicate of this bug. ***
Comment 9 Tomás Cohen Arazi 2022-08-16 12:20:25 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 10 Lucas Gass 2022-09-30 23:05:05 UTC
This shouldn't be needed in 22.05.x, no backport