Bugzilla – Attachment 192046 Details for
Bug 41182
SUSHI harvest should send a full date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41182: Allow choosing format of date passed to SUSHI
Bug-41182-Allow-choosing-format-of-date-passed-to-.patch (text/plain), 2.39 KB, created by
Nick Clemens (kidclamp)
on 2026-01-26 17:01:59 UTC
(
hide
)
Description:
Bug 41182: Allow choosing format of date passed to SUSHI
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2026-01-26 17:01:59 UTC
Size:
2.39 KB
patch
obsolete
>From d06dd4d8aa57316528548d834faef9d4744bcc96 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 4 Nov 2025 18:01:40 +0000 >Subject: [PATCH] Bug 41182: Allow choosing format of date passed to SUSHI > >These patches add a new dateformat field to erm_usage_data_providers >to allow for choosing the format sent to sushi > >The formats supported are: >yyyy-mm >yyyy-mm-dd > >yyyy-mm is the current assumption and remains the default > >To test: > 0 - Apply patches, updatedatabase, yarn build, restart all > 1 - Enable ERMModule > 2 - Add a new Data providers > 3 - Click 'Add manually' and add a provider without setting the 'Date format' field > 4 - Confirm the provider is saved with dateformat 'YYYY-MM' > 5 - Edit and set the provider date format to 'YYYY-MM-DD' > 6 - Confirm it saves correctly > 7 - Edit and set to 'YYYY-MM' and confirm saved > 8 - Edit and clear the field, it remains as 'YYYY-MM' > 9 - Edit and save as 'YYYY-MM-DD' >10 - Edit and clear the field and save >11 - Confirm it remains 'YYYY-MM-DD' >12 - Run unit tests >--- > Koha/ERM/EUsage/UsageDataProvider.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/Koha/ERM/EUsage/UsageDataProvider.pm b/Koha/ERM/EUsage/UsageDataProvider.pm >index 97ccac6cbb4..89603623c30 100644 >--- a/Koha/ERM/EUsage/UsageDataProvider.pm >+++ b/Koha/ERM/EUsage/UsageDataProvider.pm >@@ -396,14 +396,15 @@ sub _build_url_query { > $self->erm_usage_data_provider_id; > } > >- my $url = $self->_validate_url( $self->service_url, 'harvest' ); >+ my $url = $self->_validate_url( $self->service_url, 'harvest' ); >+ my $date_format_length = $self->dateformat && $self->dateformat eq "yyyy-mm-dd" ? 10 : 7; > > $url .= lc $self->{report_type}; > $url .= '?customer_id=' . $self->customer_id; > $url .= '&requestor_id=' . $self->requestor_id if $self->requestor_id; > $url .= '&api_key=' . $self->api_key if $self->api_key; >- $url .= '&begin_date=' . substr $self->{begin_date}, 0, 7 if $self->{begin_date}; >- $url .= '&end_date=' . substr $self->{end_date}, 0, 7 if $self->{end_date}; >+ $url .= '&begin_date=' . substr $self->{begin_date}, 0, $date_format_length if $self->{begin_date}; >+ $url .= '&end_date=' . substr $self->{end_date}, 0, $date_format_length if $self->{end_date}; > $url .= '&platform=' . $self->service_platform if $self->service_platform; > > return $url; >-- >2.39.5
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 41182
:
189044
|
190713
|
192041
|
192042
|
192043
|
192044
|
192045
| 192046 |
192047
|
192048
|
192049
|
192050