Bug 22739 - Self check in module JS breaks if SelfCheckInTimeout is unset
Summary: Self check in module JS breaks if SelfCheckInTimeout is unset
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Self checkout (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-18 17:56 UTC by Nick Clemens
Modified: 2019-10-14 20:02 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05


Attachments
Bug 22739: Test SelfCheckInTimeout <> 0, not just defined (1.35 KB, patch)
2019-04-19 12:36 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 22739: Test SelfCheckInTimeout <> 0, not just defined (1.39 KB, patch)
2019-04-24 15:17 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22739: Test SelfCheckInTimeout <> 0, not just defined (1.46 KB, patch)
2019-04-24 15:19 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2019-04-18 17:56:38 UTC
The code in sci-main.pl tries to set this, but fails:

# Make sure timeout has a reasonable value
my $timeout = C4::Context->preference('SelfCheckInTimeout') // 120;
$template->param( refresh_timeout => $timeout );


To recreate:
1 - Blank the syspref SelfCheckInTimeout
2 - Attempt to checkin something via sci
3 - Error: Your request included no check-ins.

Additionally, it would be nice to be able to return to the main interface if this error is received
Comment 1 Tomás Cohen Arazi 2019-04-19 12:36:39 UTC
Created attachment 88354 [details] [review]
Bug 22739: Test SelfCheckInTimeout <> 0, not just defined

On sci-main.pl the preference value is tested for 'defined'. This patch
tests it is different than empty string too. This was causing a
JavaScript syntax error, that made it display a wrong message.

To test:
1 - Blank the syspref SelfCheckInTimeout
2 - Attempt to checkin something via sci
=> FAIL: The 'Your request included no check-ins.' message is printed.
3 - Apply this patch, reload the sci-main.pl page
4 - Attempt to checkin something via sci
=> SUCCESS: The UI correctly stacks the scanned barcodes
5 - Sign off :-D
Comment 2 Liz Rea 2019-04-24 15:17:36 UTC
Created attachment 88635 [details] [review]
Bug 22739: Test SelfCheckInTimeout <> 0, not just defined

On sci-main.pl the preference value is tested for 'defined'. This patch
tests it is different than empty string too. This was causing a
JavaScript syntax error, that made it display a wrong message.

To test:
1 - Blank the syspref SelfCheckInTimeout
2 - Attempt to checkin something via sci
=> FAIL: The 'Your request included no check-ins.' message is printed.
3 - Apply this patch, reload the sci-main.pl page
4 - Attempt to checkin something via sci
=> SUCCESS: The UI correctly stacks the scanned barcodes
5 - Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 3 Kyle M Hall 2019-04-24 15:19:30 UTC
Created attachment 88636 [details] [review]
Bug 22739: Test SelfCheckInTimeout <> 0, not just defined

On sci-main.pl the preference value is tested for 'defined'. This patch
tests it is different than empty string too. This was causing a
JavaScript syntax error, that made it display a wrong message.

To test:
1 - Blank the syspref SelfCheckInTimeout
2 - Attempt to checkin something via sci
=> FAIL: The 'Your request included no check-ins.' message is printed.
3 - Apply this patch, reload the sci-main.pl page
4 - Attempt to checkin something via sci
=> SUCCESS: The UI correctly stacks the scanned barcodes
5 - Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Nick Clemens 2019-04-25 11:58:54 UTC
Awesome work all!

Pushed to master for 19.05
Comment 5 Martin Renvoize 2019-04-26 15:12:20 UTC
Pushed to 18.11.x for 18.11.05
Comment 6 Lucas Gass 2019-05-16 01:23:03 UTC
backported to 18.05.x for 18.05.13