[Bug 7451] New: PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Bug #: 7451 Summary: PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders Classification: Unclassified Change sponsored?: --- Product: Koha Version: rel_3_6 Platform: All OS/Version: All Status: NEW Severity: critical Priority: P5 - low Component: Architecture, internals, and plumbing AssignedTo: gmcharlt@gmail.com ReportedBy: dpavlin@rot13.org QAContact: ian.walls@bywatersolutions.com When using value_builders which have AJAX callback (like cataloguing/value_builder/stocknumberam123.pl) we get JavaScript error in browser because we are not initializing $subfield_data{id} (which is used as unique identifier for this particular field instance). This problem is also evident as warnings in intranet error log like this: Use of uninitialized value $subfield_data{"id"} in concatenation (.) or string at /srv/koha_ffzg//C4/Biblio.pm line 2664 but this affect just hidden fields and is not fatal, as opposed to AJAX example which breaks functionality. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P1 - high Status|NEW |ASSIGNED AssignedTo|gmcharlt@gmail.com |dpavlin@rot13.org -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=6106 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=5955 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 --- Comment #1 from Dobrica Pavlinusic <dpavlin@rot13.org> 2012-01-17 14:25:19 UTC --- Created attachment 7198 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7198 $subfield_data{id} is used for AJAX value_builders and hidden fields In current version of code, it gets initialized too late, so it produces unitialized warnings for hidden fields (which is non-fatal) and breaks generated JavaScript for AJAX value_builders (which is fatal) This bug was introduced in ticket 6106 which is modification of 5955 which didn't have this particular problem. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7198|0 |1 is obsolete| | --- Comment #2 from Dobrica Pavlinusic <dpavlin@rot13.org> 2012-01-17 14:27:15 UTC --- Created attachment 7199 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7199 Bug 7451 - PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 - high |PATCH-Sent -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|PATCH-Sent |P1 - high Status|ASSIGNED |Needs Signoff CC| |paul.poulain@biblibre.com --- Comment #3 from Paul Poulain <paul.poulain@biblibre.com> 2012-01-17 17:37:31 UTC --- Dobrica, it seems you've missed that our workflow has changed. You shouldn't use "Patch sent" anymore, but use bug status, where all workflow status for patches have been moved. Switching to status "needs signoff" & removing priority="Patch Sent", as I think you're requesting for a signoff on your patch ;-) -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> 2012-01-17 19:04:08 UTC --- (In reply to comment #3)
Dobrica, it seems you've missed that our workflow has changed. You shouldn't use "Patch sent" anymore, but use bug status, where all workflow status for patches have been moved.
Why not remove Patch Sent from the priority list? That should help remove some confusion -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 --- Comment #5 from Paul Poulain <paul.poulain@biblibre.com> 2012-01-18 08:20:49 UTC --- (In reply to comment #4)
Why not remove Patch Sent from the priority list? That should help remove some confusion
Good question, I don't know. I've removed the field from the list. It still appears for existing bugs having this value, so i've updated the value to "PATCH-Sent (DO NOT USE)" Will send a mail to koha-devel immediatly about that -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> 2012-01-19 09:58:53 UTC --- I was testing in additem.pl and saw no bugs... because additem.pl doesn't use PrepareItemrecordDisplay but an internal subroutine generate_subfield_form which isn't affected by described problem. Why these two subs? It seems that they do quite the same job. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 --- Comment #7 from Dobrica Pavlinusic <dpavlin@rot13.org> 2012-01-19 12:19:29 UTC --- Julian, great point. It seems that generate_subfield_form is mostly similar to inner loop of PrepareItemrecordDisplay. It seems that generate_subfield_form is cleaner code than PrepareItemrecordDisplay so I would propose to move generate_subfield_form into C4::Biblio and then rewrite PrepareItemrecordDisplay to use it. Does this make sense? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=4263 -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 --- Comment #8 from Chris Cormack <chris@bigballofwax.co.nz> 2012-02-18 07:14:33 UTC --- Hmm whats the status of this patch still valid and needing testing? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 --- Comment #9 from Dobrica Pavlinusic <dpavlin@rot13.org> 2012-02-20 15:50:13 UTC --- PrepareItemrecordDisplay is used by acquisition (that's how we found this problem) and serials, and this patch fixes problem with it, so it still needs sign-off. I did took a long look at C4::Biblio::PrepareItemrecordDisplay and generate_subfield_form with goal of marging changes, but in the process I found that code diverged and I'm not brave anough just to merge them together. I'm quite confused by some parts of generate_subfield_form in cataloguing/additem.pl: if ($frameworkcode eq 'FA' && $subfieldlib->{kohafield} eq 'items.barcode'){ my $input = new CGI; $value = $input->param('barcode'); } This just doesn't seem right to me (hard-coded framework and direct access to CGI params), but hopefully somebody with more knowledge of this code could make educated guesses and merge those two implementations together in another bug? -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> 2012-02-20 15:56:38 UTC --- Hi Dobrica, I can tell you what it does :) If you scan in a barcode in circulation that is not in the database yet, Koha offers to add temporary record for it (fast add = FA). The FA framework is one of the frameworks that can be installed with Koha and similar to the ACQ framework, so it's ok that it's hard coded. After you have added the fast add record and an item with the formerly uknown barcode, saving the item will take you back to circulation and immediately check out the new item to the borrower. It's a nice integrated workflow. I can't tell if there are better ways to code it, but it's working quite nicely. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> 2012-02-27 06:27:48 UTC --- Hi Dobrica, I was able to reproduce the problem in serials: 1) I mapped the stocknumberAM123 plugin to my 952$i field and checked it worked in cataloguing. Entering AM and clickingon ... would correctly give me the next number. 2) I created a subscription in seials that would add items and tried the plugin there. There are warnings in the logs and the stocknumber is not generated. I am marking this failed QA for now, perhaps you have an idea? I had to fix a conflict when applying the patch. Perhaps I made a mistake there. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7199|0 |1 is obsolete| | --- Comment #12 from Dobrica Pavlinusic <dpavlin@rot13.org> --- Created attachment 8469 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8469&action=edit Bug 7451 - PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders In current version of code, it gets initialized too late, so it produces unitialized warnings for hidden fields (which is non-fatal) and breaks generated JavaScript for AJAX value_builders (which is fatal) This bug was introduced in ticket 6106 which is modification of 5955 which didn't have this particular problem. Since then, this code moved to C4::Items because of de-nesting patches. Test scenario: 1. define 952$i plugin: stocknumberam123.pl (this is ajax value_builder) 2. go to one of following pages and verify that plugin works: acqui/addorderiso2709.pl acqui/neworderempty.pl acqui/orderreceive.pl serials/serials-edit.pl For stocknumberam123.pl plugin to work, you have to have at least one item with stocknumber in format which this plugin expects: capital letters, space, some number -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #8469|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 8612 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=8612&action=edit [SIGNED-OFF] Bug 7451 - PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders In current version of code, it gets initialized too late, so it produces unitialized warnings for hidden fields (which is non-fatal) and breaks generated JavaScript for AJAX value_builders (which is fatal) This bug was introduced in ticket 6106 which is modification of 5955 which didn't have this particular problem. Since then, this code moved to C4::Items because of de-nesting patches. Test scenario: 1. define 952$i plugin: stocknumberam123.pl (this is ajax value_builder) 2. go to one of following pages and verify that plugin works: acqui/addorderiso2709.pl acqui/neworderempty.pl acqui/orderreceive.pl serials/serials-edit.pl For stocknumberam123.pl plugin to work, you have to have at least one item with stocknumber in format which this plugin expects: capital letters, space, some number Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works nicely, thanks for the great test plan. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #14 from Ian Walls <koha.sekjal@gmail.com> --- Moves the variable initialization in the hash out of an elsif clause into the scope higher, allowing this data to be accessible in more cases. From analysis of the code, this doesn't change what the field actually IS, just when it gets created. Marking as Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7451 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|rel_3_6 |rel_3_8 --- Comment #15 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- The patches for this bug do not apply to 3.6. If you want this included in 3.6.x, please rebase on 3.6.x and reset the version to rel_3_6. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org