Bugzilla – Attachment 59671 Details for
Bug 15030
Certain values in serials' items are lost on next edit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15030 - Certain values in serials' items are lost on next edit
Bug-15030---Certain-values-in-serials-items-are-lo.patch (text/plain), 2.86 KB, created by
Jonathan Druart
on 2017-01-31 09:29:13 UTC
(
hide
)
Description:
Bug 15030 - Certain values in serials' items are lost on next edit
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-01-31 09:29:13 UTC
Size:
2.86 KB
patch
obsolete
>From a2ee8a02ff6e9164040f63c3503a1831eac5471e Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Mon, 19 Oct 2015 12:16:05 -0400 >Subject: [PATCH] Bug 15030 - Certain values in serials' items are lost on next > edit > >When editing serials subscription, we can edit them but some values are not pulled from the DB correctly to be put in the edit box. If not noticed, the value will be overwritten on the next save. > >Test: >- Create a subscription >- Edit itemcallnumber (952o?) and make sure to have a different value than the default one. >- Save. >- Edit it again >- The saved value is not there. > >This is true for itemcallnumber and a few other fields. > >This was caused by calls to ->field($subfield). This would always fail, of course. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Items.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 3330a1f..fdcd5f9 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2936,7 +2936,7 @@ sub PrepareItemrecordDisplay { > if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' > && $defaultvalues > && $defaultvalues->{'callnumber'} ) { >- if( $itemrecord and $defaultvalues and not $itemrecord->field($subfield) ){ >+ if( $itemrecord and $defaultvalues and not $itemrecord->subfield($tag,$subfield) ){ > # if the item record exists, only use default value if the item has no callnumber > $defaultvalue = $defaultvalues->{callnumber}; > } elsif ( !$itemrecord and $defaultvalues ) { >@@ -2947,7 +2947,7 @@ sub PrepareItemrecordDisplay { > if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.holdingbranch' || $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.homebranch' ) > && $defaultvalues > && $defaultvalues->{'branchcode'} ) { >- if ( $itemrecord and $defaultvalues and not $itemrecord->field($subfield) ) { >+ if ( $itemrecord and $defaultvalues and not $itemrecord->subfield($tag,$subfield) ) { > $defaultvalue = $defaultvalues->{branchcode}; > } > } >@@ -2955,7 +2955,7 @@ sub PrepareItemrecordDisplay { > && $defaultvalues > && $defaultvalues->{'location'} ) { > >- if ( $itemrecord and $defaultvalues and not $itemrecord->field($subfield) ) { >+ if ( $itemrecord and $defaultvalues and not $itemrecord->subfield($tag,$subfield) ) { > # if the item record exists, only use default value if the item has no locationr > $defaultvalue = $defaultvalues->{location}; > } elsif ( !$itemrecord and $defaultvalues ) { >-- >2.9.3
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 15030
:
43601
|
43701
|
43785
|
44798
|
45297
|
45753
|
49908
|
49909
|
49910
|
49911
|
53449
|
53450
|
53456
|
53457
|
53458
|
53459
|
59671
|
59672
|
59673
|
59674
|
59723
|
59724
|
59725
|
59726
|
59792
|
59793
|
59794
|
59795