Bugzilla – Attachment 135205 Details for
Bug 28950
serialsUpdate cron does not mark an issue late until the next issue is expected
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28950: Mark serial late when past grace period
Bug-28950-Mark-serial-late-when-past-grace-period.patch (text/plain), 3.71 KB, created by
Nick Clemens (kidclamp)
on 2022-05-19 13:55:36 UTC
(
hide
)
Description:
Bug 28950: Mark serial late when past grace period
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-05-19 13:55:36 UTC
Size:
3.71 KB
patch
obsolete
>From f8882f4be4af8e9e55b7e04bcdbe77c8d09eaa7b Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 19 May 2022 13:50:59 +0000 >Subject: [PATCH] Bug 28950: Mark serial late when past grace period > >This script had some oddities: >- There was a LEFT JOIN to subscription, but no error printed if no subscription > I changed this to a JOIN as there is a constraint, so this shoudl not happen >- Publisheddate was checked after the SQL, moved into query >- We checked for the next issue, and marked late only if that issue was already expected > This overruled grace period, which should be the mnarker for a serial being late > The grace period should be extended if you wish to wait for next issue >- If no next published date, we reported an error on the planneddate >- Script without confirm had no reporting >--- > misc/cronjobs/serialsUpdate.pl | 43 +++++++--------------------------- > 1 file changed, 9 insertions(+), 34 deletions(-) > >diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl >index 26ebf25dde..b0b603f9fb 100755 >--- a/misc/cronjobs/serialsUpdate.pl >+++ b/misc/cronjobs/serialsUpdate.pl >@@ -93,7 +93,7 @@ my $sth = $dbh->prepare( > serial.publisheddate, > subscription.subscriptionid > FROM serial >- LEFT JOIN subscription >+ JOIN subscription > ON (subscription.subscriptionid=serial.subscriptionid) > LEFT JOIN subscription_frequencies > ON (subscription.periodicity = subscription_frequencies.id) >@@ -101,43 +101,18 @@ my $sth = $dbh->prepare( > AND subscription_frequencies.unit IS NOT NULL > AND DATE_ADD(planneddate, INTERVAL CAST(graceperiod AS SIGNED) DAY) < NOW() > AND subscription.closed = 0 >+ AND publisheddate IS NOT NULL > } > ); > $sth->execute(); > > while ( my $issue = $sth->fetchrow_hashref ) { >- >- my $subscription = &GetSubscription( $issue->{subscriptionid} ); >- my $publisheddate = $issue->{publisheddate}; >- >- if ( $subscription && $publisheddate ) { >- my $freqdata = GetSubscriptionFrequency($subscription->{'periodicity'}); >- my $nextpublisheddate = GetNextDate( $subscription, $publisheddate, $freqdata ); >- my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); >- >- if ( $nextpublisheddate && $today ) { >- my ( $year, $month, $day ) = split( /-/, $nextpublisheddate ); >- my ( $tyear, $tmonth, $tday ) = split( /-/, $today ); >- if ( check_date( $year, $month, $day ) >- && check_date( $tyear, $tmonth, $tday ) >- && Date_to_Days( $year, $month, $day ) < >- Date_to_Days( $tyear, $tmonth, $tday ) ) >- { >- $confirm >- and ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, >- $issue->{planneddate}, $issue->{publisheddate}, $issue->{publisheddatetext}, >- 3, $note ); >- $verbose >- and print "Serial issue with id=" . $issue->{serialid} . " updated\n"; >- } >- } >- else { >- $verbose >- and print "Error with serial(" >- . $issue->{serialid} >- . ") has no existent subscription(" >- . $issue->{subscriptionid} >- . ") attached or planneddate is wrong\n"; >- } >+ if ( $confirm ){ >+ ModSerialStatus( $issue->{serialid}, $issue->{serialseq}, >+ $issue->{planneddate}, $issue->{publisheddate}, $issue->{publisheddatetext}, >+ 3, $note ); >+ $verbose and print "Serial issue with id=" . $issue->{serialid} . " marked late\n"; >+ } else { >+ print "Serial issue with id=" . $issue->{serialid} . " would have been marked late\n"; > } > } >-- >2.30.2
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 28950
:
135205
|
140324
|
140462
|
141487