Bugzilla – Attachment 169311 Details for
Bug 28762
Item status shows incorrectly on course-details.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28762: Confirm return of not_for_loan in boolean context matches is_notforloan
Bug-28762-Confirm-return-of-notforloan-in-boolean-.patch (text/plain), 2.18 KB, created by
Martin Renvoize (ashimema)
on 2024-07-22 15:35:11 UTC
(
hide
)
Description:
Bug 28762: Confirm return of not_for_loan in boolean context matches is_notforloan
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-22 15:35:11 UTC
Size:
2.18 KB
patch
obsolete
>From ce465d1d125370d0eae90c9f6b67d796cf4a9cf4 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 22 Jul 2024 16:09:30 +0100 >Subject: [PATCH] Bug 28762: Confirm return of not_for_loan in boolean context > matches is_notforloan > >This patch is simply here to prove that is_notforloan is just >not_for_loan but in a boolean context.. we'll remove it in the next >patch. >--- > Koha/Item.pm | 16 +--------------- > t/db_dependent/Koha/Item.t | 6 +++--- > 2 files changed, 4 insertions(+), 18 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 2c9318cc78e..33ee8e02263 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -2409,21 +2409,7 @@ the item's notforloan status or its item type > > sub is_notforloan { > my ( $self ) = @_; >- my $is_notforloan = 0; >- >- if ( $self->notforloan ){ >- $is_notforloan = 1; >- } >- else { >- my $itemtype = $self->itemtype; >- if ($itemtype){ >- if ( $itemtype->notforloan ){ >- $is_notforloan = 1; >- } >- } >- } >- >- return $is_notforloan; >+ return $self->not_for_loan; > } > > =head3 is_denied_renewal >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 2f378f14d29..1597d0d4bda 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -2251,12 +2251,12 @@ subtest 'Notforloan tests' => sub { > my $item1 = $builder->build_sample_item; > $item1->update({ notforloan => 0 }); > $item1->itemtype->notforloan(0); >- is ( $item1->is_notforloan, 0, 'Notforloan is correctly false by item status and item type'); >+ ok( !$item1->is_notforloan, 'Notforloan is correctly false by item status and item type'); > $item1->update({ notforloan => 1 }); >- is ( $item1->is_notforloan, 1, 'Notforloan is correctly true by item status'); >+ ok( $item1->is_notforloan, 'Notforloan is correctly true by item status'); > $item1->update({ notforloan => 0 }); > $item1->itemtype->update({ notforloan => 1 }); >- is ( $item1->is_notforloan, 1, 'Notforloan is correctly true by item type'); >+ ok( $item1->is_notforloan, 'Notforloan is correctly true by item type'); > > $schema->storage->txn_rollback; > }; >-- >2.45.2
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 28762
:
123233
|
123234
|
123236
|
123237
|
124661
|
124666
|
124667
|
124668
|
124744
|
125220
|
125228
|
125229
|
125233
|
161563
|
161564
|
161565
|
161566
|
161567
|
161568
|
161569
|
161570
|
161571
|
161572
|
161573
|
161574
|
161584
|
161585
|
161586
|
161587
|
161588
|
161589
|
161590
|
161591
|
163310
|
163311
|
163312
|
163313
|
163314
|
163315
|
163316
|
163317
|
165843
|
165844
|
165845
|
165846
|
165847
|
165848
|
165849
|
165850
|
169172
|
169273
|
169274
|
169275
|
169276
|
169277
|
169278
|
169279
|
169280
|
169281
|
169311
|
169312
|
169313
|
169314
|
169354
|
169355
|
169356
|
169357
|
169358
|
169359
|
169360
|
169361
|
169362
|
169363
|
169364
|
169365
|
169366
|
169367
|
169393