Bug 30220 - Purchase suggestion defaults to first library
Summary: Purchase suggestion defaults to first library
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-03 16:11 UTC by Christopher Brannon
Modified: 2022-04-17 20:09 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.05,21.05.14


Attachments
Bug 30220: Purchase suggestion defaults to first library (2.53 KB, patch)
2022-03-03 17:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30220: Purchase suggestion defaults to first library (2.58 KB, patch)
2022-03-03 17:10 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 30220: Purchase suggestion defaults to first library (2.64 KB, patch)
2022-03-06 14:07 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 Christopher Brannon 2022-03-03 16:11:52 UTC
Patrons will not bother to change to their library.  Can we make this default to the logged in patron's home library?
Comment 1 Owen Leonard 2022-03-03 17:02:41 UTC
Created attachment 131340 [details] [review]
Bug 30220: Purchase suggestion defaults to first library

This patch updates the OPAC suggestions form to update the variable
used to pre-select the logged-in user's library.

To test, apply the patch and make sure the "suggestion" preference is
set to "Allow."

- Log in to the OPAC and click "your purchase suggestions" in the
  sidebar menu on your summary page.
- Click "New purchase suggestion."
- The selected library should match the logged-in user's home library.
Comment 2 Lucas Gass 2022-03-03 17:10:08 UTC
Created attachment 131341 [details] [review]
Bug 30220: Purchase suggestion defaults to first library

This patch updates the OPAC suggestions form to update the variable
used to pre-select the logged-in user's library.

To test, apply the patch and make sure the "suggestion" preference is
set to "Allow."

- Log in to the OPAC and click "your purchase suggestions" in the
  sidebar menu on your summary page.
- Click "New purchase suggestion."
- The selected library should match the logged-in user's home library.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 3 Lucas Gass 2022-03-03 17:12:09 UTC
I would consider this a separate issue, and will file a separate bug, but if you add branchcode to the sys pref OPACSuggestionMandatoryFields the dropdown should default to an empty value in order to force the user into making a choice.
Comment 4 Katrin Fischer 2022-03-06 14:03:59 UTC
I believe this did default to the patron's home library in the past, which would make this a regression.
Comment 5 Katrin Fischer 2022-03-06 14:07:11 UTC
Created attachment 131414 [details] [review]
Bug 30220: Purchase suggestion defaults to first library

This patch updates the OPAC suggestions form to update the variable
used to pre-select the logged-in user's library.

To test, apply the patch and make sure the "suggestion" preference is
set to "Allow."

- Log in to the OPAC and click "your purchase suggestions" in the
  sidebar menu on your summary page.
- Click "New purchase suggestion."
- The selected library should match the logged-in user's home library.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2022-03-06 14:07:49 UTC
(In reply to Lucas Gass from comment #3)
> I would consider this a separate issue, and will file a separate bug, but if
> you add branchcode to the sys pref OPACSuggestionMandatoryFields the
> dropdown should default to an empty value in order to force the user into
> making a choice.

Please do!

Also tested this with an Anonymous suggestoin and there it still defaults to the first entry, which seems ok given the use case.
Comment 7 Lucas Gass 2022-03-07 14:43:51 UTC
(In reply to Katrin Fischer from comment #6)
> (In reply to Lucas Gass from comment #3)
> > I would consider this a separate issue, and will file a separate bug, but if
> > you add branchcode to the sys pref OPACSuggestionMandatoryFields the
> > dropdown should default to an empty value in order to force the user into
> > making a choice.
> 
> Please do!
> 
> Also tested this with an Anonymous suggestoin and there it still defaults to
> the first entry, which seems ok given the use case.

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30243
Comment 8 Fridolin Somers 2022-03-16 08:31:57 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 9 Kyle M Hall 2022-03-25 12:17:23 UTC
Pushed to 21.11.x for 21.11.05
Comment 10 Andrew Fuerste-Henry 2022-04-15 17:57:46 UTC
Pushed to 21.05.x for 21.05.14
Comment 11 Christopher Brannon 2022-04-15 18:04:02 UTC
(In reply to Andrew Fuerste-Henry from comment #10)
> Pushed to 21.05.x for 21.05.14

Cool beans!  Thanks Andrew!
Comment 12 Victor Grousset/tuxayo 2022-04-17 20:09:23 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.