Bugzilla – Attachment 38506 Details for
Bug 14057
Inventory is painfully slow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14057 - A Rough Start - Compare old and new code
Bug-14057---A-Rough-Start---Compare-old-and-new-co.patch (text/plain), 2.55 KB, created by
Marc Véron
on 2015-04-25 09:49:21 UTC
(
hide
)
Description:
Bug 14057 - A Rough Start - Compare old and new code
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-04-25 09:49:21 UTC
Size:
2.55 KB
patch
obsolete
>From d00e27282def501a9139c45fcc72375abe5aa723 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Fri, 24 Apr 2015 22:19:37 +0200 >Subject: [PATCH] Bug 14057 - A Rough Start - Compare old and new code > >This patch gets values using both methods to compare the results. >For testing purposes only. > >To test: >Apply patch >Compare results by commenting /uncommenting appropriate lines after line 1154 in C4/Items.pm > >If found one difference: Old code could not handle Withdrawn status (displays 1 instead of the text) > >------ >Amended: >I changed the test code to reflect the old behaviour fixed with patch from Bug 14061 >It writes a warning if the old and the new value are not the same. >I still got differences with the Withdrawn status and found out, that it took the auth value for OPAC. >This is due to a part of the select statement in the first patch (Line 1122) that overrules the value for the staff client: IF(TB.lib_opac>'',TB.lib_opac,TB.lib) >--- > C4/Items.pm | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 2ab3b16..fbde45e 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1133,9 +1133,28 @@ sub GetItemsForInventory { > > # Auth values > foreach (keys %$row) { >+ my $new = ''; > if (defined($avmapping->{"items.$_,".$row->{'frameworkcode'}.",".$row->{$_}})) { >- $row->{$_} = $avmapping->{"items.$_,".$row->{'frameworkcode'}.",".$row->{$_}}; >+ ### WILL BE SET BELOW $row->{$_} = $avmapping->{"items.$_,".$row->{'frameworkcode'}.",".$row->{$_}}; >+ $new = $avmapping->{"items.$_,".$row->{'frameworkcode'}.",".$row->{$_}}; > } >+ >+ #######TESTING WITH OLD CODE >+ #If the koha field is mapped to a marc fielda >+ my $old = ''; >+ my ($f, $sf) = GetMarcFromKohaField("items.$_", $row->{'frameworkcode'}); >+ if ($f and $sf) { >+ # We replace the code with it's description >+ my $authvals = C4::Koha::GetKohaAuthorisedValuesFromField($f, $sf, $row->{'frameworkcode'}); >+ if ( defined ($authvals->{$row->{$_}}) ) { >+ ### WILL BE SET BELOW $row->{$_} = $authvals->{$row->{$_}} ; >+ $old = $authvals->{$row->{$_}} ; >+ } >+ } >+ #######TEST HERE OUTPUT >+ #warn "$new -- $old" if ( $new || $old ); >+ $row->{$_} = $new if ($new); >+ #$row->{$_} = $old if ($old); > } > push @results, $row; > } >-- >1.7.10.4
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 14057
:
38472
|
38482
|
38483
|
38500
|
38506
|
38507
|
38525
|
38621
|
38622
|
38636
|
38733