Bug 19870 - Loaned items show as available unless logged in
Summary: Loaned items show as available unless logged in
Status: RESOLVED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Mason James
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-22 00:47 UTC by James
Modified: 2023-10-01 15:31 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
pic (192.92 KB, image/png)
2017-12-22 01:52 UTC, Mason James
Details
Bug 19870: Loaned items show as available unless logged in (2.31 KB, patch)
2017-12-22 03:38 UTC, Mason James
Details | Diff | Splinter Review
Bug 19870: Loaned items show as available unless logged in (923 bytes, patch)
2018-08-08 20:30 UTC, Mason James
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description James 2017-12-22 00:47:25 UTC
On the OPAC search results page issued (checked out) items still show as "Availability: Items available: (1)," when not logged in. When logged in they displays correctly as " Availability: No items available: Issued (1),".
The items show correctly as issued in the details page regardless of whether the user is logged in or not and display correctly in the staff client.
Comment 1 Mason James 2017-12-22 01:34:47 UTC
(In reply to James from comment #0)
> On the OPAC search results page issued (checked out) items still show as
> "Availability: Items available: (1)," when not logged in. When logged in
> they displays correctly as " Availability: No items available: Issued (1),".
> The items show correctly as issued in the details page regardless of whether
> the user is logged in or not and display correctly in the staff client.

hmm.. i think this problem was caused by bug 17556 ?

there seems to be an odd logic error that says an item can only have an 'onloan' status.. if a user is logged in


2094             my $userenv = C4::Context->userenv;
2095             if ( $item->{onloan}
2096                 && $userenv
2097                 && $userenv->{number}
2098                 && !( Koha::Patrons->find($userenv->{number})->category->hidelostitems && $item->{itemlost} ) )
2099             {
Comment 2 Mason James 2017-12-22 01:35:39 UTC
i'll upload a quick patch for this soon...
Comment 3 Mason James 2017-12-22 01:52:47 UTC
Created attachment 70094 [details]
pic
Comment 4 Mason James 2017-12-22 01:53:45 UTC
(In reply to James from comment #0)
> On the OPAC search results page issued (checked out) items still show as
> "Availability: Items available: (1)," when not logged in. When logged in
> they displays correctly as " Availability: No items available: Issued (1),".

the workaround until a patch is pushed, is to set the following sysprefs to 'default' , (ie: use XSLT)

 - OPACXSLTResultsDisplay 
 - XSLTResultsDisplay 


pic attached
Comment 5 Mason James 2017-12-22 03:38:58 UTC
Created attachment 70095 [details] [review]
Bug 19870: Loaned items show as available unless logged in

here's a quick fix to the problem (on 17.05.00 and up)

1/ set OPACXSLTResultsDisplay = '';
2/ log out from opac

3/ search for a title in opac, see item is available in search results
4/ check out item
5/ search for a title in opac, see item is still available?1

6/ apply patch
7/ search for an title in opac, see item is now unavailable

we still need a .t/test file for resultsSearch(), but that might be a job for another day...
Comment 6 Dominic Pichette 2017-12-22 21:16:13 UTC
I got this after applying patch and searching for an item:
syntax error at /inlibro/git/koha-v1605-dev-inlibro/C4/Search.pm line 2128, near "}"
Comment 7 jmbroust 2018-03-13 14:34:09 UTC
The patch was still in need signoff, I turn it to failed QA.
I had same type of error : 
Software error:
syntax error at /home/koha/src/C4/Search.pm line 2128, near "}"
Global symbol "$items_count" requires explicit package name (did you forget to declare "my $items_count"?) at /home/koha/src/C4/Search.pm line 2225.
Global symbol "$hideatopac_count" requires explicit package name (did you forget to declare "my $hideatopac_count"?) at /home/koha/src/C4/Search.pm line 2225.
2265.

blablablabla
.....
Compilation failed in require at /home/koha/src/opac/opac-search.pl line 47.
BEGIN failed--compilation aborted at /home/koha/src/opac/opac-search.pl line 47.
Comment 8 Mason James 2018-08-08 20:30:19 UTC
Created attachment 77593 [details] [review]
Bug 19870: Loaned items show as available unless logged in

small typo fix
Comment 9 Séverine Queune 2018-09-16 21:48:17 UTC
The display I have with/without applying the patch is the same, whatever I'm locked or not.
Maybe I misunderstood something and looked on the wrong place.
Can you please add some screenshots to be sure ?
Comment 10 Owen Leonard 2018-09-26 19:01:52 UTC
I can't reproduce this bug either. Besides, the non-XSLT view is deprecated.
Comment 11 Katrin Fischer 2023-10-01 15:31:13 UTC
(In reply to Owen Leonard from comment #10)
> I can't reproduce this bug either. Besides, the non-XSLT view is deprecated.

The non-XSLT view has since been removed. Closing WONTFIX.