Bugzilla – Attachment 128411 Details for
Bug 28855
Purging suggestions test should not be on timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28855: Purging suggestions test should not be on timestamp
Bug-28855-Purging-suggestions-test-should-not-be-o.patch (text/plain), 2.27 KB, created by
David Nind
on 2021-12-11 17:37:07 UTC
(
hide
)
Description:
Bug 28855: Purging suggestions test should not be on timestamp
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-12-11 17:37:07 UTC
Size:
2.27 KB
patch
obsolete
>From 68d2d0f2a6152271d49a163b40783573d1a6149b Mon Sep 17 00:00:00 2001 >From: Marion Durand <marion.durand@biblibre.com> >Date: Fri, 22 Oct 2021 15:07:43 +0200 >Subject: [PATCH] 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> >--- > C4/Suggestions.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index ba72a1888a..649fb964e5 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -580,7 +580,7 @@ sub DelSuggestionsOlderThan { > q{ > DELETE FROM suggestions > WHERE STATUS<>'ASKED' >- AND date < ADDDATE(NOW(), ?) >+ AND manageddate < ADDDATE(NOW(), ?) > } > ); > $sth->execute("-$days"); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28855
:
127482
|
127483
|
128411
|
128412
|
128464
|
128465