Bugzilla – Attachment 8469 Details for
Bug 7451
PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7451 - PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders
Bug-7451---PrepareItemrecordDisplay-missing-subfie.patch (text/plain), 2.76 KB, created by
Dobrica Pavlinusic
on 2012-03-22 09:20:14 UTC
(
hide
)
Description:
Bug 7451 - PrepareItemrecordDisplay missing $subfield_data{id} which breaks AJAX value_builders
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2012-03-22 09:20:14 UTC
Size:
2.76 KB
patch
obsolete
>From a7de6b3d1c1e2fd296f6329ba4b0024cb7d9f3b0 Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Thu, 22 Mar 2012 10:04:50 +0100 >Subject: [PATCH] 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 >--- > C4/Items.pm | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 2f32c98..826d3b8 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2574,6 +2574,7 @@ sub PrepareItemrecordDisplay { > $subfield_data{subfield} = $subfield; > $subfield_data{countsubfield} = $cntsubf++; > $subfield_data{kohafield} = $tagslib->{$tag}->{$subfield}->{'kohafield'}; >+ $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".int(rand(1000000)); > > # $subfield_data{marc_lib}=$tagslib->{$tag}->{$subfield}->{lib}; > $subfield_data{marc_lib} = $tagslib->{$tag}->{$subfield}->{lib}; >@@ -2712,8 +2713,6 @@ sub PrepareItemrecordDisplay { > my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, undef ); > my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, undef ); > $subfield_data{random} = int(rand(1000000)); # why do we need 2 different randoms? >- my $index_subfield = int(rand(1000000)); >- $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_subfield; > $subfield_data{marc_value} = qq[<input tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" > onfocus="Focus$function_name($subfield_data{random}, '$subfield_data{id}');" > onblur=" Blur$function_name($subfield_data{random}, '$subfield_data{id}');" /> >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7451
:
7198
|
7199
|
8469
|
8612