Bug 18244 - Patron card creator does not take in account fields with underscore (B_address etc.)
Summary: Patron card creator does not take in account fields with underscore (B_addres...
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-10 10:19 UTC by Marc Véron
Modified: 2017-05-03 03:56 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18244: Patron card creator does not take in account fields with underscore (B_address etc.) (1.94 KB, patch)
2017-03-10 10:26 UTC, Marc Véron
Details | Diff | Splinter Review
Patron card layout settings to test B_address (33.65 KB, image/png)
2017-03-23 19:59 UTC, Marc Véron
Details
My card layout (36.49 KB, image/png)
2017-03-23 21:13 UTC, Christopher Brannon
Details
My card export with field name showing (7.13 KB, image/png)
2017-03-23 21:13 UTC, Christopher Brannon
Details
Re-testing same settings as in screenshot comment #5 (30.13 KB, image/png)
2017-03-24 14:30 UTC, Marc Véron
Details
[SIGNED OFF] Bug 18244: Patron card creator does not take in account fields with underscore (B_address etc.) (2.01 KB, patch)
2017-03-24 18:16 UTC, Christopher Brannon
Details | Diff | Splinter Review
Bug 18244: Patron card creator does not take in account fields with underscore (B_address etc.) (2.07 KB, patch)
2017-03-29 18:59 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2017-03-10 10:19:13 UTC
Fields with underscore like B_address do not print on patron cards.

To reproduce:
- Create patron card layout using fields with underscore in their name 
  (e.g. <surname><B_address> )
- Print (export) patron card
- Verify that fields without underscore are replaced by their value, 
  but fields with underscore do not replace but show the field name
Comment 1 Marc Véron 2017-03-10 10:26:39 UTC
Created attachment 60984 [details] [review]
Bug 18244: Patron card creator does not take in account fields with underscore (B_address etc.)

Fields with underscore like B_address do not print on patron cards.

To reproduce:
- Create patron card layout using fields with underscore in their name
  (e.g. <surname><B_address> )
- Print (export) patron card
- Verify that fields without underscore are replaced by their value,
  but fields with underscore do not replace but show the field name

To test:
- Apply patch
- Try to reproduce and verify that fields with underscore are replace
  as expected
Comment 2 Christopher Brannon 2017-03-23 19:16:23 UTC
I have applied the patch on two different computers, confirmed the changes in the patch, but I see no difference.  I still get the field name instead of the value.
Comment 3 Marc Véron 2017-03-23 19:59:59 UTC
Created attachment 61590 [details]
Patron card layout settings to test B_address

(In reply to Christopher Brannon from comment #2)
> I have applied the patch on two different computers, confirmed the changes
> in the patch, but I see no difference.  I still get the field name instead
> of the value.

I re-tested with the settings for a test layout, see screenshot attached.
Field <B_address> displays it's contents as expected.

- What are your settings?
- Restart Plack?
Comment 4 Christopher Brannon 2017-03-23 21:12:29 UTC
I've cleared cache, restarted apache2, restarted memcache, restarted all (restart_all), no luck.

I'm using the demo layout that installed with Koha, and just editing the 2nd field to read "Address: <B_address>"

I go to manage Card batches and on my one patron I click Export.  When I open the pdf, I still see <B_address>.

I will attach my screen shots.
Comment 5 Christopher Brannon 2017-03-23 21:13:23 UTC
Created attachment 61591 [details]
My card layout
Comment 6 Christopher Brannon 2017-03-23 21:13:52 UTC
Created attachment 61592 [details]
My card export with field name showing
Comment 7 Marc Véron 2017-03-24 14:30:55 UTC
Created attachment 61611 [details]
Re-testing same settings as in screenshot comment #5

(In reply to Christopher Brannon from comment #4)
> I've cleared cache, restarted apache2, restarted memcache, restarted all
> (restart_all), no luck.
> 
> I'm using the demo layout that installed with Koha, and just editing the 2nd
> field to read "Address: <B_address>"
> 
> I go to manage Card batches and on my one patron I click Export.  When I
> open the pdf, I still see <B_address>.
> 
> I will attach my screen shots.

I repeated with your settings, it works as expected (see screenshot attached). After taking the screenshots, I tested with other B_-fields as well, e.g. <B_city>, they display as expected.

It did not work immediately after applying the patch, I had to re-start Plack and to reload the page for batch management. Tested with single export and with export of entire batch.

Hmm, where is the difference...?
Comment 8 Christopher Brannon 2017-03-24 14:46:13 UTC
> I repeated with your settings, it works as expected (see screenshot
> attached). After taking the screenshots, I tested with other B_-fields as
> well, e.g. <B_city>, they display as expected.
> 
> It did not work immediately after applying the patch, I had to re-start
> Plack and to reload the page for batch management. Tested with single export
> and with export of entire batch.
> 
> Hmm, where is the difference...?

Don't know.  I've tried everything I know. Don't know why loading a patch should be this difficult.  I even tried another browser.  If it is sticking anywhere, it is on the server side, not the browser, since the change is not reflected in a new browser.  I'll keep beating up on it.
Comment 9 Christopher Brannon 2017-03-24 15:12:55 UTC
Are you testing the patch on a dedicated test server, or are you using kohadevbox?
Comment 10 Marc Véron 2017-03-24 15:26:41 UTC
Not kohadevbox. It's a VM with an install from packets that I gitified. Current version is 16.12.00.015

Just an idea because I remember a similar situation:
What happens if you edit the patched C4/Patroncards/Patroncard.pm file and intentionally insert some errors in order to make it crash? - Can you provoke the crash or does export still behave as before?
Comment 11 Christopher Brannon 2017-03-24 15:51:00 UTC
Throwing stray text into the file you patched doesn't seem to effect anything.  I know my test environment is working, as I can apply another patch and see the effects of it right away.  We're missing something.
Comment 12 Christopher Brannon 2017-03-24 18:16:43 UTC
Created attachment 61629 [details] [review]
[SIGNED OFF] Bug 18244: Patron card creator does not take in account fields with underscore (B_address etc.)

Fields with underscore like B_address do not print on patron cards.

To reproduce:
- Create patron card layout using fields with underscore in their name
  (e.g. <surname><B_address> )
- Print (export) patron card
- Verify that fields without underscore are replaced by their value,
  but fields with underscore do not replace but show the field name

To test:
- Apply patch
- Try to reproduce and verify that fields with underscore are replace
  as expected

Works as expected.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 13 Christopher Brannon 2017-03-24 18:17:53 UTC
Note to kohadevbox testers: disable plack.  Kohadevbox is not pointing to all the files in the kohaclone environment with plack enabled.  This is an issue with kohadevbox, not the patch.
Comment 14 Jonathan Druart 2017-03-29 18:59:07 UTC
Created attachment 61701 [details] [review]
Bug 18244: Patron card creator does not take in account fields with underscore (B_address etc.)

Fields with underscore like B_address do not print on patron cards.

To reproduce:
- Create patron card layout using fields with underscore in their name
  (e.g. <surname><B_address> )
- Print (export) patron card
- Verify that fields without underscore are replaced by their value,
  but fields with underscore do not replace but show the field name

To test:
- Apply patch
- Try to reproduce and verify that fields with underscore are replace
  as expected

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 15 Kyle M Hall 2017-03-31 13:28:07 UTC
Pushed to master for 17.05, thanks Marc!
Comment 16 Katrin Fischer 2017-04-02 17:10:23 UTC
This patch has been pushed to 16.11.x and will be in 16.11.07.
Comment 17 Julian Maurice 2017-04-21 10:09:26 UTC
Pushed to 3.22.x for 3.22.20
Comment 18 Mason James 2017-05-03 03:56:33 UTC
Pushed to 16.05.x, for 16.05.12 release