Bugzilla – Attachment 38500 Details for
Bug 14057
Inventory is painfully slow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[TESTPATCH] Bug 14057 - A Rough Start - Compare old and new code
TESTPATCH-Bug-14057---A-Rough-Start---Compare-old-.patch (text/plain), 2.14 KB, created by
Marc Véron
on 2015-04-24 20:28:27 UTC
(
hide
)
Description:
[TESTPATCH] Bug 14057 - A Rough Start - Compare old and new code
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-04-24 20:28:27 UTC
Size:
2.14 KB
patch
obsolete
>From cae51878c607004a735c4f0f00c4047cfd05828e 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] [TESTPATCH] 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) >--- > 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