Time Nick Message 03:04 koha-jenkins Project Koha_Master_D10-Full build #16: ABORTED in 1 min 12 sec: https://jenkins.koha-community.org/job/Koha_Master_D10-Full/16/ 03:59 koha-jenkins Project Koha_Master_D10-Full-i386 build #1: UNSTABLE in 53 min: https://jenkins.koha-community.org/job/Koha_Master_D10-Full-i386/1/ 04:06 koha-jenkins Project Koha_Master_D10-Full-armhf build #1: FAILURE in 3 min 10 sec: https://jenkins.koha-community.org/job/Koha_Master_D10-Full-armhf/1/ 05:22 dcook Another day another bug.. 06:13 paxed i just love how overdue_notices log, even with DEBUG on, just logs the sql, and all kinds of other crap, but doesn't actually log what borrowers it handles. 07:18 reiveune hello 07:44 fridolin hi 07:51 magnuse \o/ 08:16 ashimema mornin' #koha 08:17 cait1 morning #koha! 08:39 magnuse kia ora ashimema and cait1 08:40 magnuse sweet as 08:41 cait1 heh 10:44 tcohen morning 11:50 tuxayo hi #koha :) 11:58 TimothyAlexis Using this 11:59 TimothyAlexis my $accountlines = Koha::Account::Lines->search({ amountoutstanding => { '>' => 0 }, status => 'RETURNED', date => { '<' => ?????}) 11:59 TimothyAlexis What could I use to calculate the date? 12:03 cait1 what kidn of date are you loking for? 12:03 TimothyAlexis Does it want a string? 12:06 TimothyAlexis Something compared to DateTime->now->subtract(days => 10)->strftime(something-something); 12:07 TimothyAlexis But I suppose this one is proper? Koha::DateUtils qw( dt_from_string ); 12:07 Joubu you need to use datetime_parser, search for '$dtf' 12:07 Joubu Koha/Patrons.pm: my $dtf = Koha::Database->new->schema->storage->datetime_parser; 12:07 Joubu Koha/Patrons.pm: { returndate => { '<' => $dtf->format_datetime($older_than_date), }, 12:08 TimothyAlexis Thank you Joubu 12:08 TimothyAlexis Joubu++ 12:13 TimothyAlexis I'm not sure I need to use a string. 12:14 TimothyAlexis the date should be something like today - 10 days 12:23 tcohen doesn't DBIC translate DateTime objects correctly? 12:23 tcohen without calling the parser explicitly? 12:27 TimothyAlexis I want $accountlines to contain the records compared to this raw sql: 12:28 TimothyAlexis SELECT * FROM accountlines WHERE date < date_sub(curdate(), INTERVAL 10 DAY) AND status = 'RETURNED' AND amountoutstanding > 0; 12:34 ashimema you could use raw sql 12:35 ashimema string ref if memory serves 12:36 TimothyAlexis Joonas Kylmälä requested that "Instead of doing RAW SQL use Koha Koha::Account::Line objects and ->delete" 12:36 ashimema sorry 12:36 ashimema I meant.. raw via objects 12:36 ashimema just digging out an example 12:37 TimothyAlexis Looking at this example: { returndate => { '<' => $dtf->format_datetime($older_than_date)} $older_than_date is a string, correct? So it's parsing that and using a DateTime object as a parameter, right? 12:38 ashimema `date => { '<' => \"NOW()" }` for example 12:39 ashimema or `date => { '<' => \["date_sub(now(), INTERVAL ? DAY)", "10" ]}` 12:40 ashimema so the first example there, a string ref, tells dbic to use the NOW() as raw sql in your where statement... 12:41 ashimema the second example, an array ref, tells dbic you're passing in raw sql + bind params. 12:41 ashimema so the `"10"` there could happily be `$days` 12:41 ashimema hope that helps 12:42 TimothyAlexis It does. 12:42 ashimema or.. as you've done above.. you could calculate the date using DateTime in perl.. then pass that into format_datetime to get a properly formatted string.. 12:42 ashimema nice to have options ;) 12:43 ashimema https://metacpan.org/pod/SQL::Abstract::Classic#Specific-comparison-operators 12:43 ashimema for further reading if you need it ;) 12:44 ashimema my general advice is.. don't lean on literals too much.. but there are certainly cases where they make allot of sense.. (in my humble opinion.. this is probably one of them 😉 ) 13:01 TimothyAlexis I would have prefered to just use the Event Scheduler in the database. It would have required 5 minutes of work instead of 2 weeks. 13:02 TimothyAlexis 🤣 13:05 ashimema now i'm intrigued to know what you're developing 13:05 TimothyAlexis bug 27080 13:05 huginn Bug http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27080 enhancement, P5 - low, ---, timothy_alexis.vass, ASSIGNED , Add --statute-barred-fees option to cleanup_database.pl to purge all fees where the item has been returned and the fee is older than the given number of days. 13:05 ashimema aha, i see 13:08 pastebot "TimothyAlexis" at 127.0.0.1 pasted "I would have done something like this" (6 lines) at http://paste.koha-community.org/26388 13:09 ashimema sounds like a nice idea for a plugin 13:09 ashimema something to manage mysql events ;) 13:12 pastebot "TimothyAlexis" at 127.0.0.1 pasted "Would this be correct?" (7 lines) at http://paste.koha-community.org/26389 13:28 ashimema looks reasonable to me 13:28 ashimema I can't remember.. if there's a non-commit and verbose modes to the script you may want to split it.. 13:29 ashimema instead of chaining delete immediately.. 13:29 ashimema set the search as a variable 13:30 ashimema then call `$results->delete if $confirm;` and `print "Will delete " . $results->count if $verbose` 13:30 ashimema something along those lines 13:45 TimothyAlexis ashimema++ 13:55 ashimema tuxayo around? 14:01 pastebot "TimothyAlexis" at 127.0.0.1 pasted "What is the problem with implementing something compared to this, which is also in cleanup_database.pl? Why even involve all that complexity in the first place?" (18 lines) at http://paste.koha-community.org/26390 14:25 caroline anyone around know how to use this? https://translate.koha-community.org/tools/ 14:26 caroline I put in my email address and got a response email, but https://koha-community.org/manual/20.05/zh_TW/html/ doesn't seem to have changed 14:26 caroline compared to https://translate.koha-community.org/manual/20.05/zh_TW/html/index.html 14:34 caroline Did i somehow break Pootle? https://translate.koha-community.org/ 14:37 Joubu I've just restarted apache, it fixed the error 14:37 Joubu you should email Bernardo about the export tool 14:39 caroline he's the one who sent it to me hehe! 14:39 caroline thanks for restarting! :) 14:40 Joubu caroline: then tell him it does not seem to work :) 14:41 caroline it's not the tool that took down apache was it? 14:41 Joubu I don't know 14:41 huginn News from kohagit: Bug 27144: Fix syntax error that prevents deleting patrons <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=08c34b33e4f9bf8f4f515ca769ed923999d3991f> 14:41 huginn News from kohagit: Bug 26665: (bug 20168 follow-up) Fix path to bootstrap js file <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=61f1f02dd791ee587d545d71e3c08fc5eb35c770> 14:41 huginn News from kohagit: Bug 27003: Item creation log must be done after the item is created <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=b3b3781ea3745a382cd38e808a2846a6fd933f3c> 14:41 huginn News from kohagit: Bug 27128: (bug 25728 follow-up) Don't prefill av's code <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=c6263d078e9374b1712d7b2a452a1ccb614deaef> 14:41 huginn News from kohagit: Bug 26976: Display 0 if renewalsallowed is not defined <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=01a7dc70670801fab021ba7e4f782542c744bbee> 14:41 huginn News from kohagit: Bug 27030: Add missing perldoc for Processing hold status to C4::Reserves <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=2c4cd7f3f260d44801e36a7582c8dc384afb93e7> 14:41 huginn News from kohagit: Bug 26336: Add hint before and remove select after staging with no items <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=5cdae4c64b7da609ddeb94d77ffa5bdbb4cb8ca1> 14:41 huginn News from kohagit: Bug 26336: Disable 'Item processing' dropdown if no item <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=cee2e630b4e26ebfaef6cf3f41a79df3cf697b01> 14:41 huginn News from kohagit: Bug 12430: Add unit tests for C4::Search::buildQuery <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=66b2bb7ca898007533f775a2bdc413c9d00c6ca7> 14:41 huginn News from kohagit: Bug 16067: Remove FastMmap <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=fc1158389f5a25ee9d62c2cb84742daa5b97ec50> 14:41 huginn News from kohagit: Bug 12430: Use releance ranking without QueryWeightFields <https://git.koha-community.org/gitweb/?p=koha.git;a=commitdiff;h=f6b5dfa4b718fb74654448b5663cb264b5c376b7> 14:57 TimothyAlexis How do I manually obsolete an attachment in a bug report? 14:58 TimothyAlexis I can go to details > edit details and then check it as obsolete, but then what? :/ 14:58 Joubu then submit 15:01 TimothyAlexis OK, so... after having worked with this bug 27080 I want to refactor/reindent/clean up the entire code in cleanup_database.pl so that it's consistent. 15:01 huginn Bug http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27080 enhancement, P5 - low, ---, timothy_alexis.vass, Needs Signoff , Add --statute-barred-fees option to cleanup_database.pl to purge all fees where the item has been returned and the fee is older than the given number of days. 15:01 TimothyAlexis How many bug reports do you want me to create for that? 15:02 Joubu what do you want to do exactly? 15:02 Joubu To me the most important thing is to improve the output for the dry-run mode 15:03 TimothyAlexis I want to make the sub usage { text pretty. 15:04 TimothyAlexis I want to replace all the C4 stuff 15:05 TimothyAlexis After this comment: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27080#c3 15:05 huginn Bug 27080: enhancement, P5 - low, ---, timothy_alexis.vass, Needs Signoff , Add --statute-barred-fees option to cleanup_database.pl to purge all fees where the item has been returned and the fee is older than the given number of days. 15:07 Joubu the usage sub must be moved to the POD, and pod2usage used instead 15:08 Joubu you won't mange (easily) to remove all the C4 stuffs from this script 15:08 Joubu the usage move requires its own bug 15:09 Joubu DELETE FROM message_queue => Can be moved to Koha easily if you create the Koha::Objects modules 15:10 Joubu DELETE FROM action_logs => very easy, the Koha modules exist already 15:11 Joubu TimothyAlexis: Are you aware of filter_by_last_update? 15:11 TimothyAlexis OK so the purpose of what I want to do is to prevent suffering for the next Human being who needs to look at this code. 15:11 Joubu you should have used it in 27080 I think 15:12 Joubu man, you are lucky, I cleaned it (a bit) last cycle :D 15:12 TimothyAlexis *bows in gratitude* 15:14 TimothyAlexis What is filter_by_last_update ? 15:14 Joubu Koha/Objects.pm 15:14 Joubu 266 sub filter_by_last_update { 15:15 Joubu it's the method used by all the Koha::Objects from cleanup_database.pl to select the rows you want to remove given their "age" 15:18 TimothyAlexis How could I have used it? 15:19 TimothyAlexis If you want to improve the patch, please go ahead, I need to leave the office. 15:32 koha-jenkins Project Koha_Master_D9 build #1514: UNSTABLE in 48 min: https://jenkins.koha-community.org/job/Koha_Master_D9/1514/ 15:35 koha-jenkins Project Koha_Master_D10 build #430: UNSTABLE in 50 min: https://jenkins.koha-community.org/job/Koha_Master_D10/430/ 15:38 koha-jenkins Project Koha_Master_D11 build #168: UNSTABLE in 52 min: https://jenkins.koha-community.org/job/Koha_Master_D11/168/ 16:15 reiveune bye 16:19 koha-jenkins Project Koha_20.11_U20 build #5: SUCCESS in 46 min: https://jenkins.koha-community.org/job/Koha_20.11_U20/5/ 16:21 koha-jenkins Project Koha_20.11_U2010 build #6: FAILURE in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_U2010/6/ 16:22 koha-jenkins Project Koha_20.11_D9 build #7: FAILURE in 3 min 7 sec: https://jenkins.koha-community.org/job/Koha_20.11_D9/7/ 16:26 koha-jenkins Project Koha_Master_U2010 build #61: UNSTABLE in 50 min: https://jenkins.koha-community.org/job/Koha_Master_U2010/61/ 16:28 koha-jenkins Project Koha_20.11_U18 build #6: SUCCESS in 1 hr 5 min: https://jenkins.koha-community.org/job/Koha_20.11_U18/6/ 16:31 koha-jenkins Project Koha_20.11_D10 build #21: SUCCESS in 52 min: https://jenkins.koha-community.org/job/Koha_20.11_D10/21/ 16:31 koha-jenkins Project Koha_20.11_D11 build #11: FAILURE in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_D11/11/ 16:32 koha-jenkins Project Koha_20.11_U16 build #4: FAILURE in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_U16/4/ 16:41 koha-jenkins Project Koha_20.11_D9 build #8: STILL FAILING in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_D9/8/ 16:43 koha-jenkins Project Koha_20.11_D11 build #12: STILL FAILING in 12 min: https://jenkins.koha-community.org/job/Koha_20.11_D11/12/ 16:50 tuxayo Does anyone know how in a unit test just ensure that no errors happened? I get "No tests run for subtest" 16:51 tuxayo Ok, I could just do something like 16:51 tuxayo is(blessed($club_hold), 'Koha::Club::Hold', 'add returns a Koha::Club::Hold'); 16:51 koha-jenkins Project Koha_20.11_D11 build #13: STILL FAILING in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_D11/13/ 17:01 koha-jenkins Project Koha_20.11_D9 build #9: STILL FAILING in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_D9/9/ 17:11 koha-jenkins Project Koha_20.11_D9 build #10: STILL FAILING in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_D9/10/ 17:14 koha-jenkins Project Koha_20.11_U20 build #6: SUCCESS in 48 min: https://jenkins.koha-community.org/job/Koha_20.11_U20/6/ 17:21 koha-jenkins Project Koha_20.11_D9 build #11: STILL FAILING in 10 min: https://jenkins.koha-community.org/job/Koha_20.11_D9/11/ 17:27 koha-jenkins Yippee, build fixed! 17:27 wahanui Congratulations! 17:27 koha-jenkins Project Koha_20.11_U16 build #5: FIXED in 54 min: https://jenkins.koha-community.org/job/Koha_20.11_U16/5/ 17:34 koha-jenkins Yippee, build fixed! 17:34 wahanui Congratulations! 17:34 koha-jenkins Project Koha_20.11_U2010 build #7: FIXED in 1 hr 6 min: https://jenkins.koha-community.org/job/Koha_20.11_U2010/7/ 17:40 koha-jenkins Project Koha_20.11_U16 build #6: SUCCESS in 57 min: https://jenkins.koha-community.org/job/Koha_20.11_U16/6/ 18:14 koha-jenkins Yippee, build fixed! 18:14 wahanui Congratulations! 18:15 koha-jenkins Project Koha_20.11_D9 build #12: FIXED in 53 min: https://jenkins.koha-community.org/job/Koha_20.11_D9/12/ 18:19 tcohen tuxayo can you elaborate a bit more? 18:26 pastebot "tuxayo" at 127.0.0.1 pasted "tchoen here is my test, "add when holds policy = 0"" (118 lines) at http://paste.koha-community.org/26393 18:26 tuxayo tcohen: hi :) 18:26 tuxayo Just checking that Koha::Club::Hold::add() worked. 18:27 tuxayo It shouldn't in the end but I'm triggering a bug that I introduced 18:27 tcohen it should return the Koha::Club::Hold object, right? 18:27 tuxayo tcohen: IIUC the other test then yes. That's why I copied it for now. 18:28 tuxayo When I'll have fixed my bug, I'll likely have test for an excepted exception but I don't know it yet. 18:29 tuxayo Because hold policy = 0 should cause it to fail. 18:30 tcohen somehow unrelated, but I recently had a situation in which I needed to test some method was called under some circumstances inside a method 18:30 tcohen *not called* 18:31 tcohen writing a full test for that was complicated because it envolved EnqueueLetter and all that stuff 18:32 tcohen I solved it by setting a global variable to 0, mocking EnqueueLetter to set the variable to 1, and testing variable == 0, after calling the method 18:32 koha-jenkins Project Koha_20.11_U2010 build #8: SUCCESS in 58 min: https://jenkins.koha-community.org/job/Koha_20.11_U2010/8/ 18:32 tuxayo tricky! 18:32 tcohen I mention it because I was too close to get into a rabbit hole 18:32 tuxayo (jenkins approves) 18:32 tcohen for something that didn't deserve it 21:41 tuxayo Hi :) 21:41 tuxayo About creating an atomicupdate, what should one do with the last line? «NewVersion( $DBversion, XXXXX, "Description");» 21:41 tuxayo https://wiki.koha-community.org/wiki/Database_updates#How_to_write_an_atomicupdate_file 21:41 tuxayo Should the version be filled before running locally or should I comment it?