[Bug 8604] New: Patron cards made for patrons which don't have patron images use preceding card's image
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 Priority: P5 - low Change sponsored?: --- Bug ID: 8604 Assignee: cnighswonger@foundations.edu Summary: Patron cards made for patrons which don't have patron images use preceding card's image Severity: normal Classification: Unclassified OS: All Reporter: derrynj@gmail.com Hardware: All Status: NEW Version: rel_3_8 Component: Label printing Product: Koha Steps to reproduce: 1. In the patron creator, set up a layout with patron images enabled 2. Create a batch starting with a patron that does NOT have a picture stored 3. Next choose one that DOES 4. Finally choose one that does NOT 5. Export the batch 6. Resulting PDF will show i) the first one is correct (no picture) ii) the second one will correctly show it's own picture iii) the third one will (incorrectly) show the previous patron's picture -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 gabrielle.dusseault@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cnighswonger@foundations.ed | |u, | |elibris.helpdesk@gmail.com, | |gabrielle.dusseault@gmail.c | |om -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|cnighswonger@foundations.ed | |u | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 --- Comment #1 from Chris Nighswonger <cnighswonger@foundations.edu> --- Removing myself from the CC since I am the default assignee. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 lightpurpledye@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lightpurpledye@gmail.com --- Comment #2 from lightpurpledye@gmail.com --- This problem goes away if you comment out lines 152 - 159 of /usr/share/koha/intranet/cgi-bin/patroncards (lines beginning "elsif ($images->{$_}->{'data_source'}->[0]->{'image_source'} eq 'creator_images') {" ). However, doing this also breaks the display of any "Other Image"s (non-patron photo images) on the card layout. I have tried adding "$image_data = undef" to the beginning of the foreach loop, and between lines 152 and 153, under the assumption that $image_data still contains the image data from the previous iteration until it is reassigned, but this had no effect. I think that for some reason the elsif condition on line 152 is matching users which don't have a photo assigned, but I still don't know why that would result in the behaviour observed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 --- Comment #3 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to lightpurpledye from comment #2)
This problem goes away if you comment out lines 152 - 159 of /usr/share/koha/intranet/cgi-bin/patroncards (lines beginning "elsif ($images->{$_}->{'data_source'}->[0]->{'image_source'} eq 'creator_images') {" ).
However, doing this also breaks the display of any "Other Image"s (non-patron photo images) on the card layout.
The file in question is create-pdf.pl Your test indicates that at least on your system there may be patron images stored where "creator_images" should be. This entire block of code (PROCESS_IMAGES [1]) is prefaced on layout xml like this: <images name="image_1" Dx="139.4" Ox="0" Oy="0" Sx="0" Sy="0" Tx="0" Ty="0"> <data_source image_name="Temp Card Front PNG" image_source="creator_images" /> </images> It looks at the data_source key in particular for the "source" of the image. "creator_images" are stored in a table by the same name in the db. This is a different source than patron images which are stored in the patronimage table. The fact that commenting out the condition which allows for retrieval of creator_images "fixes" the problem would seem to indicate a misunderstanding of what images should be stored where. An image stored in the creator_images table and used in a patroncard layout will appear on every card in any batch using that layout. Images stored in the patronimage table will (should) appear only on cards which include that patron. I have not had time to try this bug out, but what you describe seems to be more related to misunderstanding what images should be stored where. Hopefully that clarifies things a bit. If I've not understood, feel free to let me know. [1] http://tinyurl.com/kfh5vbn -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 --- Comment #4 from lightpurpledye@gmail.com --- Oops, I did mean create-pdf.pl, well spotted. I don't think I've misunderstood where images should be stored, however. I only have one image in the creator_images table in the db, which I wish to be displayed on every card. The patron images are all in the patronimage table (uploaded using the bulk Upload Patron Images tool). It's just that some patrons do not have images set, but creating a card for them still displays an image, but of a different patron. N.B. The self-checkout module does not display any images for these patrons, and there is no image set for them in the patronimage table, so I am fairly sure it's a bug in the Patron Card Creator module rather than anything else. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 --- Comment #5 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to lightpurpledye from comment #4)
Oops, I did mean create-pdf.pl, well spotted.
I don't think I've misunderstood where images should be stored, however. I only have one image in the creator_images table in the db, which I wish to be displayed on every card.
The patron images are all in the patronimage table (uploaded using the bulk Upload Patron Images tool). It's just that some patrons do not have images set, but creating a card for them still displays an image, but of a different patron.
So it sounds like your images are in the correct location. However, that only makes it a bit more confusing as to why commenting out code which inserts the image for every card would "fix" the duplicate patron image issue. So I'll just have to find time to duplicate the bug and look at what's going on there. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 lightpurpledye@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.8 |3.14 --- Comment #6 from lightpurpledye@gmail.com --- Possibly related: If the image file for one patron has a greater horizontal:vertical ratio than the image file for the patron immediately after them in the batch, then the first patron's image is shown below the second patron's image. e.g. Steps to reproduce 1. In the patron creator, set up a layout with patron images enabled. 2. Create a batch starting with a patron that has a 300x100 image stored. 3. Next choose one with a 200x100 image. 4. Export the batch. 5. Resulting PDF will show: i) The first one is correct (patron a's picture) ii) The second one is incorrect (There are 100 pixels of patron a showing underneath patron b). This suggests to me that when the PROCESS_IMAGES loop has an iteration it actually prints the image in every subsequent image position and then relies on the incorrect images being printed over in the next iteration. This would explain why, if a patron does not have an image stored, they would get the previous patron's image. If this turns out to be unrelated, I can open a separate bug report for it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8604 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #7 from Marc Véron <veron@veron.ch> --- Is this still valid for current master? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org