Bug 31158 - Can't filter suggestions by date ranges
Summary: Can't filter suggestions by date ranges
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 31347 (view as bug list)
Depends on: 23991
Blocks:
  Show dependency treegraph
 
Reported: 2022-07-14 18:58 UTC by Owen Leonard
Modified: 2023-06-08 22:26 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates (2.57 KB, patch)
2022-08-01 06:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 30879: DBRev 22.06.00.031 (1.43 KB, patch)
2022-08-02 20:13 UTC, Rachael
Details | Diff | Splinter Review
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates (2.62 KB, patch)
2022-08-07 22:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31158: (bug 23991 follow-up) Fix suggestion search by dates (2.69 KB, patch)
2022-08-09 16:20 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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