https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31969
--- Comment #18 from Jonathan Druart <[email protected]> --- Since when are we sending a confirm flag to a method? Why isn't this simply reusing the same pattern that exist for other flags? 381 if ($pMessages) { 382 print "Purging messages older than $pMessages days.\n" if $verbose; 383 my $messages = Koha::Patron::Messages->filter_by_last_update( 384 { timestamp_column_name => 'message_date', days => $pMessages } ); 385 my $count = $messages->count; 386 $messages->delete if $confirm; 387 if ( $verbose ) { 388 say $confirm 389 ? sprintf( "Done with purging %d messages", $count ) 390 : sprintf( "%d messages would have been removed", $count ); 391 } 392 } That's all what you needed. No additional methods, unit tests, etc. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
