Bug 23900 - Label maker cannot concatenate database fields
Summary: Label maker cannot concatenate database fields
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
: 16503 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-10-25 13:21 UTC by Andrew Fuerste-Henry
Modified: 2020-11-30 21:47 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.05, 19.05.10
Circulation function:


Attachments
Bug 23900: Teach label maker to concat database fields (1.56 KB, patch)
2019-11-11 16:56 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23900: Teach label maker to concat database fields (1.62 KB, patch)
2019-11-12 13:21 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 23900: Add tests (3.10 KB, patch)
2020-02-26 11:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 23900: Teach label maker to concat database fields (1.70 KB, patch)
2020-03-20 11:04 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 23900: Add tests (3.16 KB, patch)
2020-03-20 11:04 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2019-10-25 13:21:41 UTC
The manual explains that one can use double quotes when listing fields for one's label layout to make two or more values concatenate onto a single line in one's label. 

From https://koha-community.org/manual//18.11/en/html/tools.html#layouts:
"You can also enclose a whitespace-separated list of fields to concatenate on one line in double quotes, for example “099a 099b” or “itemcallnumber barcode”. 

Testing this on both 18.11 and 19.05, this works for MARC fields but not for database fields.

To test:
- define a label layout with this field list: "100a 245s","enumchron copynumber"
- find or create a record with values for all of those fields
- generate a label for that record
- the 100a and 245s successfully display on one line
- the enumchron and copynumber do not display at all
Comment 1 Jonathan Druart 2019-11-11 16:56:53 UTC
Created attachment 95273 [details] [review]
Bug 23900: Teach label maker to concat database fields

Test plan:
- define a label layout with this field list: "100a 245s","enumchron copynumber"
- find or create a record with values for all of those fields
- generate a label for that record
- the 100a and 245s successfully display on one line
- the enumchron and copynumber are displayed and separated by a space

Try other combinations
Comment 2 ByWater Sandboxes 2019-11-12 13:21:16 UTC
Created attachment 95307 [details] [review]
Bug 23900: Teach label maker to concat database fields

Test plan:
- define a label layout with this field list: "100a 245s","enumchron copynumber"
- find or create a record with values for all of those fields
- generate a label for that record
- the 100a and 245s successfully display on one line
- the enumchron and copynumber are displayed and separated by a space

Try other combinations

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Katrin Fischer 2019-11-13 14:48:19 UTC
Hi Jonathan, could we have a regression test for this please?
Comment 4 Jonathan Druart 2019-11-13 15:03:46 UTC
(In reply to Katrin Fischer from comment #3)
> Hi Jonathan, could we have a regression test for this please?

I tried but failed. I do not think the whole thing is tested at all.
Comment 5 Marcel de Rooy 2019-11-21 08:47:17 UTC
Please add tests :)
Comment 6 Jonathan Druart 2019-11-21 10:22:59 UTC
(In reply to Marcel de Rooy from comment #5)
> Please add tests :)

I have answered previously, I will not.
Comment 7 Marcel de Rooy 2019-11-21 10:42:57 UTC
(In reply to Jonathan Druart from comment #6)
> (In reply to Marcel de Rooy from comment #5)
> > Please add tests :)
> 
> I have answered previously, I will not.

Didnt even see that, reading so fast :)
Comment 8 Marcel de Rooy 2019-11-21 10:54:51 UTC
(In reply to Jonathan Druart from comment #4)
> (In reply to Katrin Fischer from comment #3)
> > Hi Jonathan, could we have a regression test for this please?
> 
> I tried but failed. I do not think the whole thing is tested at all.

t/Labels.t
t/Labels_split_ccn.t
t/Labels_split_lccn.t
t/db_dependent/Labels/t_Label.t
Comment 9 Jonathan Druart 2020-02-26 11:51:24 UTC
Created attachment 99641 [details] [review]
Bug 23900: Add tests
Comment 10 Kyle M Hall (khall) 2020-03-20 11:04:42 UTC
Created attachment 101072 [details] [review]
Bug 23900: Teach label maker to concat database fields

Test plan:
- define a label layout with this field list: "100a 245s","enumchron copynumber"
- find or create a record with values for all of those fields
- generate a label for that record
- the 100a and 245s successfully display on one line
- the enumchron and copynumber are displayed and separated by a space

Try other combinations

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall (khall) 2020-03-20 11:04:52 UTC
Created attachment 101073 [details] [review]
Bug 23900: Add tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Martin Renvoize (ashimema) 2020-03-20 15:43:30 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 13 Joy Nelson 2020-04-03 21:03:25 UTC
backported to 19.11.x for 19.11.05
Comment 14 Lucas Gass (lukeg) 2020-04-13 19:19:42 UTC
backported to 19.05.x for 19.05.10
Comment 15 Hayley Pelham 2020-04-15 23:10:23 UTC
I cannot get any of the data fields showing on my labels in 18.11.x, following this test plan. Is somebody able to confirm that this works in 18.11 and that this patch fixes any issues?
Comment 16 Katrin Fischer 2020-04-18 22:47:31 UTC
*** Bug 16503 has been marked as a duplicate of this bug. ***