Bugzilla – Attachment 7198 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]
$subfield_data{id} is used for AJAX value_builders and hidden fields
subfielddataid-is-used-for-AJAX-valuebuilders-and-.patch (text/plain), 2.66 KB, created by
Dobrica Pavlinusic
on 2012-01-17 14:25:19 UTC
(
hide
)
Description:
$subfield_data{id} is used for AJAX value_builders and hidden fields
Filename:
MIME Type:
Creator:
Dobrica Pavlinusic
Created:
2012-01-17 14:25:19 UTC
Size:
2.66 KB
patch
obsolete
>From 9ce80378296a39c7c3d11e74c64c75e20f05b96f Mon Sep 17 00:00:00 2001 >From: Dobrica Pavlinusic <dpavlin@rot13.org> >Date: Tue, 17 Jan 2012 15:15:42 +0100 >Subject: [PATCH] $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. > >http://bugs.koha-community.org/show_bug.cgi?id=7451 >--- > C4/Biblio.pm | 5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index ac78ae3..f3c57d5 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -2507,6 +2507,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}; >@@ -2642,11 +2643,9 @@ sub PrepareItemrecordDisplay { > my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'}; > if (do $plugin) { > my $temp; >+ $subfield_data{random} = int(rand(1000000)); # why do we need 2 different randoms? > 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