Bug 18536

Summary: Generating CSV using profile in serials late issues doesn't work as described
Product: Koha Reporter: Josef Moravec <josef.moravec>
Component: SerialsAssignee: Josef Moravec <josef.moravec>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: colin.campbell, julian.maurice, katrin.fischer, kyle, m.de.rooy, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 18536: Generating CSV using profile in serials late issues doesn't work as described
Bug 18536: Generating CSV using profile in serials late issues doesn't work as described
[SIGNED OFF] Bug 18536: Generating CSV using profile in serials late issues doesn't work as described
Bug 18536: Generating CSV using profile in serials late issues doesn't work as described
Bug 18536: [QA Follow-up] Tiny regex simplification

Description Josef Moravec 2017-05-04 08:55:39 UTC
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.

Patch follows
Comment 1 Josef Moravec 2017-05-04 09:00:21 UTC
Created attachment 63058 [details] [review]
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
Comment 2 Josef Moravec 2017-05-10 13:35:32 UTC
Created attachment 63342 [details] [review]
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
Comment 3 Katrin Fischer 2017-05-10 21:58:57 UTC
Created attachment 63373 [details] [review]
[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>
Comment 4 Marcel de Rooy 2017-05-19 09:42:57 UTC
Created attachment 63574 [details] [review]
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>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2017-05-19 09:43:01 UTC
Created attachment 63575 [details] [review]
Bug 18536: [QA Follow-up] Tiny regex simplification

Simplify regex for removing table name.
No need to escape a dot between the square brackets. No need to specify a
number of 1 between parentheses.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Kyle M Hall 2017-05-19 14:43:34 UTC
Pushed to master for 17.05, thanks Josef!
Comment 7 Katrin Fischer 2017-05-21 21:26:35 UTC
These patches have been pushed to 16.11.x and will be in 16.11.08.
Comment 8 Julian Maurice 2017-05-22 14:17:40 UTC
Pushed to 3.22.x for 3.22.21
Comment 9 Mason James 2017-05-24 03:14:47 UTC
Pushed to 16.05.x, for 16.05.13 release