Bug 17886 - Don't show option to add to existing list if there are no lists in staff
Summary: Don't show option to add to existing list if there are no lists in staff
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Caitlin Goodger
QA Contact: Testopia
URL: /cgi-bin/koha/virtualshelves/addbybib...
Keywords: Academy
Depends on: 14544
Blocks: 21297
  Show dependency treegraph
 
Reported: 2017-01-11 18:30 UTC by Owen Leonard
Modified: 2019-10-14 19:58 UTC (History)
10 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:


Attachments
Bug 17886 Don't show option to add to existing list if there are no (4.94 KB, patch)
2017-01-18 03:27 UTC, Caitlin Goodger
Details | Diff | Splinter Review
Bug 17886 Don't show option to add to existing list if there are no (4.52 KB, patch)
2017-01-18 07:22 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 17886 Don't show option to add to existing list if there are no (2.03 KB, patch)
2017-01-19 20:28 UTC, Caitlin Goodger
Details | Diff | Splinter Review
Bug 17886: Forgot to count the lists shared to patron (1.79 KB, patch)
2017-01-20 16:19 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 17886: Forgot to count the lists shared to patron (1.96 KB, patch)
2017-03-15 18:37 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 17886: Don't show option to add to existing list if there are no lists (7.25 KB, patch)
2018-05-29 17:39 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17886: Don't show option to add to existing list if there are no lists (7.35 KB, patch)
2018-06-22 19:49 UTC, Maryse Simard
Details | Diff | Splinter Review
Bug 17886: Don't show option to add to existing list if there are no lists (7.41 KB, patch)
2018-06-26 06:12 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2017-01-11 18:30:07 UTC
If you add a title to a list by choosing 'Add To' -> 'List' from the toolbar on the detail page, a pop-up window is triggered. This window has a section for "Select an existing list" and "Add to a new list." The first should not display if there are no existing lists.
Comment 1 Caitlin Goodger 2017-01-18 03:27:36 UTC Comment hidden (obsolete)
Comment 2 Claire Gravely 2017-01-18 07:22:42 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2017-01-19 12:14:11 UTC
Hello Caitling, we have the same problem at the OPAC, could you fix it as well?
Comment 4 Caitlin Goodger 2017-01-19 20:28:29 UTC Comment hidden (obsolete)
Comment 5 M. Tompsett 2017-01-20 16:18:39 UTC Comment hidden (obsolete)
Comment 6 M. Tompsett 2017-01-20 16:19:06 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2017-01-24 15:41:14 UTC
(In reply to M. Tompsett from comment #5)

> I believe this is the wrong solution. It is much simpler.

Since you're obsoleting a patch from an Academy student in favor of your own I think it's worthwhile to give a detailed explanation of your reasoning.
Comment 8 M. Tompsett 2017-02-01 05:30:41 UTC
(In reply to Owen Leonard from comment #7)
> (In reply to M. Tompsett from comment #5)
> 
> > I believe this is the wrong solution. It is much simpler.
> 
> Since you're obsoleting a patch from an Academy student in favor of your own
> I think it's worthwhile to give a detailed explanation of your reasoning.

Sorry for taking so long to notice this. Valid point, Owen.

The problem is not the 'Add To' heading section (as hinted at by the 3rd obsolete patch).
The problem is not around line 40ish (as hinted at by the 1st two obsolete patches).
The problem is when there are no lists, it makes no sense to show that you can select a list. The problem is the code correctly checks the count method of the two shelf types, but fails to do so on the third on line 26.

By simplying adding .count to the third shelf type, the options available are properly shown. There is no need to add a condition. The existing condition was broken.

Though, what I do miss about the first two patches are corrections in indentation.
Comment 9 Marc Véron 2017-03-15 18:37:11 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2017-03-17 14:36:12 UTC
I am lost here...

First patch fixed the staff interface only, now the patch fixes the opac interface only...

Can we have both please?
Comment 11 Owen Leonard 2018-05-29 17:39:24 UTC Comment hidden (obsolete)
Comment 12 Maryse Simard 2018-06-22 19:49:12 UTC
Created attachment 76306 [details] [review]
Bug 17886: Don't show option to add to existing list if there are no lists

This patch modifies the page for adding a title to a list so that the
"Add to existing list" option doesn't appear if there are no lists
defined.

TEST PLAN
---------
1) Make sure no lists exist at all.
2) Make there is at least one findable biblio record entered
3) Find that biblio record in the OPAC
4) Click 'Save to your lists'
   -- Notice that the whole save to list section is there.
5) Apply this patch
6) Click 'Cancel'
7) Click 'Save to your lists'
   -- Notice you can only add now, which makes sense.
8) Run koha qa test tools.

Perform the same tests in the staff client.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and the patch works.
Comment 13 Katrin Fischer 2018-06-26 06:11:09 UTC
OPAC seems to be ok in my tests. If there is still an issue I suggest solving it with a separate bug and patch to have this moving on.
Comment 14 Katrin Fischer 2018-06-26 06:12:02 UTC
Created attachment 76428 [details] [review]
Bug 17886: Don't show option to add to existing list if there are no lists

This patch modifies the page for adding a title to a list so that the
"Add to existing list" option doesn't appear if there are no lists
defined.

TEST PLAN
---------
1) Make sure no lists exist at all.
2) Make there is at least one findable biblio record entered
3) Find that biblio record in the OPAC
4) Click 'Save to your lists'
   -- Notice that the whole save to list section is there.
5) Apply this patch
6) Click 'Cancel'
7) Click 'Save to your lists'
   -- Notice you can only add now, which makes sense.
8) Run koha qa test tools.

Perform the same tests in the staff client.

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Followed the test plan and the patch works.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Nick Clemens 2018-06-29 21:03:16 UTC
Awesome work all!

Pushed to master for 18.11
Comment 16 Martin Renvoize 2018-07-02 08:34:10 UTC
Pushed to 18.05.x for 18.05.02
Comment 17 Fridolin SOMERS 2018-07-04 08:13:18 UTC
Pushed to 17.11.x for 17.11.08