Koha-clms/C4
Marion Durand 36d71b9d67 Bug 28855: Purging suggestions test should not be on timestamp
DelSuggestionsOlderThan is on "date", a timestamp. It can be a problem
because "date" is updated when we update the database, in consequences
all the suggestions take the same date.

This patch use 'manageddate' instead.

In order to test this patch, you will need to have some suggestions
where "Managed on" (suggestions.manageddate in the database) is older
from "Last updated" (suggestions.date in the database). This can append
during some specific update. If you don't have such data, you will have
to add them via SQL request.

Example of sql for insertion (ID is the patron id of a librarian which
can manage suggestions):
INSERT INTO suggestions (suggestedby, suggesteddate, managedby,
manageddate, acceptedby, accepteddate, STATUS, title) VALUES (1,
'2020-10-13', 1, '2020-10-26', 1, '2020-10-26', 'ACCEPTED', 'title');

Test plan:
1- Choose a date and find (or add) a suggestion where:
    - "Last updated" is not older than this date
    - "Managed on" is older than this date
    - "Status" is different from "Pending" ("ASKED" in database)
Calculate number_days = today's date - chosen date
Example: (Today's date 28/10/2021, chosen date : 28/10/2020,
number_days=365)
Suggestion | .. | Managed on | .. | Last updated | .. | Status
title      | .. | 10/26/2020 | .. | 05/15/2021   | .. | Accepted

2- Run cron job
/home/koha/src/misc/cronjobs/purge_suggestions.pl --confirm --days number_days

3- Check that this suggestion has not been deleted

4- Apply the patch

5- Repeat steps 1 and 2

6- Check that this suggestion has been deleted

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 90bfdbc92f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
2021-12-17 21:05:20 +00:00
..
AuthoritiesMarc
…
Barcodes Bug 26673: Fix perlcritic complains 2020-11-02 08:42:20 +01:00
ClassSortRoutine
…
ClassSplitRoutine
…
Creators Bug 25852: Improve C4::Creators::Lib reliability under plack 2020-07-31 10:03:26 +02:00
External
…
Form
…
Heading [21.05] Bug 21958: Add missing subfields 2021-09-23 11:44:02 +00:00
ILSDI Bug 28630: Add track_login_daily to ILSDI::AuthenticatePatron 2021-08-06 14:29:16 -04:00
Installer
…
Labels
…
Linker Bug 28676: Cache and retrieve match_count when searching a cached heading 2021-10-01 13:30:47 -04:00
Members Bug 24447: Changing 'DUE' to example in database that exists. 2021-01-22 13:46:41 +01:00
OAI Bug 25460: Update OAI sets when adding/editing/deleting item records 2020-10-15 12:56:30 +02:00
Output
…
Patroncards Bug 25459: Makes barcode position respect units in patron cards layout 2021-11-05 11:53:41 -04:00
Reports Bug 27884: Add html support for report mails 2021-11-05 11:54:38 -04:00
SIP Bug 29564: Use List::MoreUtils so SIP U16/Xenial does not break 2021-11-30 11:01:20 -05:00
Search
…
Serials
…
Utils Bug 29134: (follow-up) Specify which borrowernumber 2021-10-26 08:42:42 -04:00
Accounts.pm Bug 22394: Remove C4::Accounts::manualinvoice 2020-11-04 12:59:33 +01:00
Acquisition.pm Bug 27203: Calculate tax based on ecost if unitprice not set 2021-05-11 15:09:13 +02:00
Auth.pm Bug 28847: Cleanup of branch limitsand fix OPAC_SEARCH_LIMIT 2021-11-22 13:37:19 -05:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 20854: (QA follow-up) Improve readability 2021-04-21 10:51:29 +02:00
Auth_with_ldap.pm Bug 28490: Revert "Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables" 2021-06-18 07:47:34 -04:00
Auth_with_shibboleth.pm Bug 28367: (follow-up) Fix plack condition in C4/Auth_with_shibboleth.pm 2021-05-18 11:26:27 +02:00
AuthoritiesMarc.pm Bug 27173: Add plugin hooks for authority record changes 2021-11-05 14:22:07 -04:00
BackgroundJob.pm
…
Barcodes.pm
…
Biblio.pm Bug 28384: Add 'no_items' option to TransformMarcToKoha 2021-07-16 09:32:12 -04:00
Breeding.pm Bug 29437: Search reservoir for term as title, author, or variations of ISBN 2021-11-19 12:01:51 -05:00
Budgets.pm Bug 23195: Always count shipping costs as 'spent' 2021-04-22 14:50:11 +02:00
Calendar.pm
…
Charset.pm
…
Circulation.pm Bug 29062: (QA follow-up) Add comment 2021-10-08 11:15:52 -04:00
ClassSortRoutine.pm
…
ClassSource.pm
…
ClassSplitRoutine.pm
…
Context.pm Bug 28317: Use the default CGI::Session serializer 2021-05-19 14:45:32 +02:00
Contract.pm
…
CourseReserves.pm
…
Creators.pm
…
Debug.pm
…
HTML5Media.pm Bug 27422: YouTube videos are HTTPS only 2021-02-08 17:09:34 +01:00
Heading.pm Bug 21958: Fix bibliographic record field comparison with authority 2021-04-01 17:13:56 +02:00
HoldsQueue.pm Bug 28510: Remove marking of closed branches as 'disable_transfer' 2021-10-08 08:18:45 -04:00
ImportBatch.pm Bug 24469: Move the new queries to a dedicated ImportBatch subroutine 2021-02-18 11:52:59 +01:00
ImportExportFramework.pm Bug 27968: Fix framework import if isurl has an incorrect value 2021-04-23 10:03:30 +02:00
InstallAuth.pm Bug 28317: Use the default CGI::Session serializer 2021-05-19 14:45:32 +02:00
Installer.pm Bug 28281: Remove double decoding when importing installation data 2021-05-07 14:44:00 +02:00
ItemCirculationAlertPreference.pm Bug 23271: Replace search_limited with search_with_library_limits 2021-04-21 15:25:07 +02:00
Items.pm Bug 29243: Correct call when adding items from staged records 2021-10-22 11:06:59 -04:00
Koha.pm Bug 27746: prevent regexp undefined warning when checking subfield contents ($oclc) 2021-04-14 15:25:26 +02:00
Labels.pm
…
Languages.pm Bug 27491: Rename system preference opaclanguages to OPACLanguages 2021-01-22 14:59:27 +01:00
Letters.pm Bug 29330: (QA follow-up) Change to message/rfc822 2021-11-22 13:20:57 -05:00
Linker.pm
…
Log.pm Bug 23632: Remove C4::Logs::GetLogs 2020-08-18 15:45:48 +02:00
MarcModificationTemplates.pm
…
Matcher.pm Bug 26199: Include LDR for match check/match point 2021-03-09 17:20:47 +01:00
Members.pm Bug 28001: (bug 27050 follow-up) Fix delete_patrons if no category passed 2021-04-16 12:28:17 +02:00
Message.pm Bug 28230: Store C4::Message->{metadata} as Perl string always 2021-04-28 11:07:06 +02:00
NewsChannels.pm Bug 26205: (QA follow-up) Change OPACNEWS to just NEWS 2021-07-09 08:35:42 -04:00
Output.pm
…
Overdues.pm Bug 28144: Check if issue_id defined 2021-04-27 16:23:49 +02:00
Patroncards.pm
…
Record.pm Bug 27673: Fix encoding issues 2021-02-16 14:54:50 +01:00
Reports.pm Bug 27486: Rename system preference delimiter to CSVDelimiter 2021-01-29 09:03:45 +01:00
Reserves.pm Bug 25619: Adjust POD and move date check before logging 2021-09-03 10:00:50 -04:00
Ris.pm Bug 27673: Fix encoding issues 2021-02-16 14:54:50 +01:00
RotatingCollections.pm Bug 17202: Don't report an item in a collection if the collection doesn't exist 2021-04-28 11:07:06 +02:00
SMS.pm Bug 27673: Replace YAML with YAML::XS 2021-02-16 14:54:50 +01:00
Scheduler.pm
…
Scrubber.pm
…
Search.pm Bug 28847: Remove dead code and make regex consistent 2021-11-22 13:37:20 -05:00
Serials.pm Bug 27842: Update serial.biblionumber when a subscription is linked with another record 2021-04-28 11:07:06 +02:00
Service.pm Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
ShelfBrowser.pm Bug 26673: Remove shebangs from Perl modules 2020-10-26 00:14:42 +01:00
SocialData.pm
…
Stats.pm
…
Suggestions.pm Bug 28855: Purging suggestions test should not be on timestamp 2021-12-17 21:05:20 +00:00
TTParser.pm Bug 26673: Remove #!/usr/bin/env perl from .pm modules too 2020-10-26 00:14:42 +01:00
Tags.pm
…
Templates.pm Bug 28303: Fix plugins system with multiple pluginsdir settings 2021-10-08 10:25:09 -04:00
TmplToken.pm
…
TmplTokenType.pm
…
UsageStats.pm Bug 28108: Fix filtering 2021-05-10 15:52:53 +02:00
XISBN.pm Bug 26364: Don't discard the passed isbn 2021-01-07 15:37:15 +01:00
XSLT.pm Bug 28373: [21.05] Fix transformMARCXML4XSLT export in C4::XSLT 2021-09-10 08:11:05 -04:00