Bugzilla – Attachment 63373 Details for
Bug 18536
Generating CSV using profile in serials late issues doesn't work as described
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 18536: Generating CSV using profile in serials late issues doesn't work as described
SIGNED-OFF-Bug-18536-Generating-CSV-using-profile-.patch (text/plain), 2.06 KB, created by
Katrin Fischer
on 2017-05-10 21:58:57 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 18536: Generating CSV using profile in serials late issues doesn't work as described
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2017-05-10 21:58:57 UTC
Size:
2.06 KB
patch
obsolete
>From 1d1a99ef9d9040c33694f8b8b8279a144c8c8923 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Thu, 4 May 2017 08:54:30 +0000 >Subject: [PATCH] [SIGNED OFF] Bug 18536: Generating CSV using profile in > serials late issues doesn't work as described > >Description on editing csv profiles says: > >"You can also use your own headers (instead of the ones from Koha) by >prefixing the field name with an header, followed by the equal sign." > >So the header should be optional, but in fact it's mandatory. Also the >regular expression to cut table name from beginning of db column is not >right. > >Test plan: > >0. Don't apply the patch >1. Make two CSV profiles for exporting late issues > a) SUPPLIER=aqbooksellers.name|TITLE=subscription.title|ISSUENUMBER=serial.serialseq|LATE SINCE=serial.planneddate > b) aqbooksellers.name|TITLE=subscription.title|ISSUE NUMBER=serial.serialseq|LATE SINCE=serial.planneddate >2. Export late issues, profile a) works as expected, profile b) doesn't >3. Apply the patch >4. Both profiles should work > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > serials/lateissues-export.pl | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > >diff --git a/serials/lateissues-export.pl b/serials/lateissues-export.pl >index cc23ddc..0bd82a6 100755 >--- a/serials/lateissues-export.pl >+++ b/serials/lateissues-export.pl >@@ -46,14 +46,19 @@ my $csv = Text::CSV_XS->new({ > my $content = $csv_profile->content; > my ( @headers, @fields ); > while ( $content =~ / >- ([^=]+) # header >- = >- ([^\|]+) # fieldname (table.row or row) >+ ([^=\|]+) # header >+ =? >+ ([^\|]*) # fieldname (table.row or row) > \|? /gxms > ) { >- push @headers, $1; >- my $field = $2; >- $field =~ s/[^\.]*\.?//; # Remove the table name if exists. >+ my $header = $1; >+ my $field = ($2 eq '') ? $1 : $2; >+ >+ $header =~ s/^\s+|\s+$//g; # Trim whitespaces >+ push @headers, $header; >+ >+ $field =~ s/[^\.]*\.{1}//; # Remove the table name if exists. >+ $field =~ s/^\s+|\s+$//g; # Trim whitespaces > push @fields, $field; > } > >-- >2.7.4
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 18536
:
63058
|
63342
|
63373
|
63574
|
63575