Bug 19706 - Item search: Unsupported format html
Summary: Item search: Unsupported format html
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P3 major (vote)
Assignee: Nick Clemens
QA Contact: Josef Moravec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-28 06:54 UTC by Elias
Modified: 2018-05-24 11:27 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 19706 - Fix bad json formed when there are no CCODE values (1.55 KB, patch)
2017-12-12 11:18 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 19706: Fix bad json formed when there are no CCODE values (1.60 KB, patch)
2017-12-12 16:52 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 19706: (followup) - correct variable name 'ccodes' not 'ccode' (1.21 KB, patch)
2017-12-14 12:44 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 19706: Fix bad json formed when there are no CCODE values (1.66 KB, patch)
2017-12-15 20:22 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 19706: (followup) - correct variable name 'ccodes' not 'ccode' (1.27 KB, patch)
2017-12-15 20:22 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 19706: Fix bad json formed when there are no CCODE values (1.92 KB, patch)
2017-12-17 07:31 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 19706: (QA follow-up) Hide the collection code selector if no value is defined (for consistency) (1.60 KB, patch)
2017-12-17 07:32 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Elias 2017-11-28 06:54:14 UTC
After upgrading to 17.05.06.000 Item search no longer works, as long as screen is selected.
CSV and Barcodes file working as intended.

When screen is the selected output you get the following software error:
Unsupported format html at /usr/share/koha/intranet/cgi-bin/catalogue/itemsearch.pl line 41.

Steps to reproduce:

1. upgrade to 17.05.06.000

2. in the intra: search -> item search

3. leave everything as it is and click search
Comment 1 Jonathan Druart 2017-12-05 17:46:06 UTC
I do not recreate, the format must be "json", unless you have javascript disabled.
Can you confirm you did not disable javascript?
Comment 2 Nick Clemens 2017-12-12 11:15:31 UTC
This appears to be an issue if there are no CCODE values defined. The column limiting code is malformed and javascript error breaks functionality.
Comment 3 Nick Clemens 2017-12-12 11:18:38 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2017-12-12 16:52:48 UTC
Created attachment 69745 [details] [review]
Bug 19706: Fix bad json formed when there are no CCODE values

To test:
1 - Delete all ccode values in your system
2 - Load the item search page
3 - View the console and note a js error
4 - Try to perform an item search to screen
5 - Internal server error ("unsupported format 'html'" in logs)
6 - Apply patch
7 - Reload page
8 - Note js error is gone
9 - Perform search to screen, success!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Josef Moravec 2017-12-14 11:51:31 UTC
Comment on attachment 69745 [details] [review]
Bug 19706: Fix bad json formed when there are no CCODE values

Review of attachment 69745 [details] [review]:
-----------------------------------------------------------------

Sorry, does not work, if you have defined some values in CCODE category, the select is not visible either

::: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt
@@ +363,4 @@
>                      { 'type': 'text' },
>                      { 'type': 'text' },
>                      { 'type': 'text' },
> +                    [% IF ccode.size %]

should be ccodes.size (plural)
Comment 6 Nick Clemens 2017-12-14 12:44:39 UTC
Created attachment 69800 [details] [review]
Bug 19706: (followup) - correct variable name 'ccodes' not 'ccode'

To test:
1 - Have some values in CCODE authorised values
2 - Ensure collection drop down on item search displays correctly
3 - Ensure item search returns results ot screen with no js errors
Comment 7 David Bourgault 2017-12-15 20:22:06 UTC
Created attachment 69831 [details] [review]
Bug 19706: Fix bad json formed when there are no CCODE values

To test:
1 - Delete all ccode values in your system
2 - Load the item search page
3 - View the console and note a js error
4 - Try to perform an item search to screen
5 - Internal server error ("unsupported format 'html'" in logs)
6 - Apply patch
7 - Reload page
8 - Note js error is gone
9 - Perform search to screen, success!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Comment 8 David Bourgault 2017-12-15 20:22:41 UTC
Created attachment 69832 [details] [review]
Bug 19706: (followup) - correct variable name 'ccodes' not 'ccode'

To test:
1 - Have some values in CCODE authorised values
2 - Ensure collection drop down on item search displays correctly
3 - Ensure item search returns results ot screen with no js errors

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>
Comment 9 Josef Moravec 2017-12-17 07:31:56 UTC
Created attachment 69835 [details] [review]
Bug 19706: Fix bad json formed when there are no CCODE values

To test:
1 - Delete all ccode values in your system
2 - Load the item search page
3 - View the console and note a js error
4 - Try to perform an item search to screen
5 - Internal server error ("unsupported format 'html'" in logs)
6 - Apply patch
7 - Reload page
8 - Note js error is gone
9 - Perform search to screen, success!

To test there is no regression:
1 - Have some values in CCODE authorised values
2 - Ensure collection drop down on item search displays correctly
3 - Ensure item search returns results ot screen with no js errors

Signed-off-by Owen Leonard <oleonard@myacpl.org>

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 10 Josef Moravec 2017-12-17 07:32:01 UTC
Created attachment 69836 [details] [review]
Bug 19706: (QA follow-up) Hide the collection code selector if no value is defined (for consistency)

Test plan:
0) Go to item search
1) Do have some authorized values in CCODE category -> selector of
collection is visible
2) Don't have any authorized value in CCODE category -> selector of
collection is not visible

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 11 Josef Moravec 2017-12-17 07:34:39 UTC
I squashed the two patches to simplify history and added follow-up to make the item search form behave consistant - if there is no ccode value, the selector for collection is not visible on item search form.
Comment 12 Jonathan Druart 2017-12-18 15:19:16 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 13 Nick Clemens 2017-12-20 13:02:43 UTC
Awesome work all! Pushed to stable for 17.11.01