Staff Catalog: Default Search and Preferred Library settings are deleted when Search Preference page is loaded

Bug #2037685 reported by Jennifer Pringle
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Committed
Medium
Unassigned
3.12
Fix Committed
Undecided
Unassigned

Bug Description

Evergreen 3.11.1

In the angular staff catalogue go to Search Preferences.
Enter values for all the preferences.
Click Return
The search library will update to match your Default Search Library.
Click Search Preferences again.
The values you selected still show.
Click Return.
The search library has gone back to the top org unit.
Click Search Preferences again
Default Search Library and Preferred Library are now blank. Values for the other three settings are still filled in.

I am seeing this on both our 3.11.1 test server and EOLI's 3.11.1 community server.

In 3.9 the Default Search Library and Preferred Library value remain as expected no matter how many times you go in and out of Search Preference.

Possibly related to https://bugs.launchpad.net/evergreen/+bug/2007603 ??

tags: added: regression
tags: added: ux-forms
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

I'm seeing a "Setting Update Succeeded" toast message whenever I load the Search Preferences page, regardless of whether eg.search.search_lib is set for my workstation. When it *is* set, loading the page retrieves that setting for my workstation, but then triggers an open-ils.cstore.direct.actor.workstation_setting.delete call that wipes it out. The same thing happens with eg.search.pref_lib, but not with the other search preferences.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

In other words, loading the Search Preferences page deletes your Default Search Library and Preferred Library settings from the database, but this isn't obvious because the old values remain visible on the Search Preferences page after they're deleted from the db.

summary: - Staff Catalogue: Default Search and Preferred Library Get Cleared on
- Return
+ Staff Catalog: Default Search and Preferred Library settings are
+ deleted when Search Preference page is loaded
Changed in evergreen:
assignee: nobody → Jeff Davis (jdavis-sitka)
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

I think this is what's happening: eg.search.search_lib and eg.search.pref_lib are fetched when the PreferencesComponent is initialized, but the values are null when the Search Preferences page is first loaded, and this appears to trigger an update that deletes the settings. The fetch request eventually completes and updates the page with the correct values, but this happens via applyOrgId which explicitly doesn't trigger an onChange event -- so the correct values are displayed to the user but they remain deleted behind the scenes.

I've tinkered a bit but haven't been able to come up with a fix.

Changed in evergreen:
assignee: Jeff Davis (jdavis-sitka) → nobody
Revision history for this message
Brian Kennedy (brianmk) wrote :

I've made a quick fix that won't save the contents of the Search Preferences page if the values of Default Search and Preferred Library are 0.

This appears to avoid the issue of the search preferences getting blown away when returning to the search preferences page.

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=52be374ee27e44e8d777692aeb398ecbc9f68409

tags: added: pullrequest
Changed in evergreen:
milestone: none → 3.11.2
milestone: 3.11.2 → 3.12-beta
milestone: 3.12-beta → 3.11.2
Revision history for this message
Elizabeth Davis (elidavis) wrote :

I have tested this, and it is working as anticipated. Something I did notice was if I made changes to my Search Preferences in the Catalog, the Search preferences under Administration-Workstation changed to match. If I made the change in Admin-Workstation, they didn't change in the Catalog Search Preferences. Is that intentional?

Revision history for this message
Susan Morrison (smorrison425) wrote :

There is an open bug for the behavior Elizabeth described: https://bugs.launchpad.net/evergreen/+bug/1993850

Revision history for this message
Elizabeth Davis (elidavis) wrote :

Thanks Susan! I will consent to the sign-off on this code with my name, Elizabeth Davis and my email address is <email address hidden>

Changed in evergreen:
assignee: nobody → Terran McCanna (tmccanna)
Revision history for this message
Terran McCanna (tmccanna) wrote :

Works for me! Thanks Brian and all testers!

Fix committed and pushed back to 3.11.

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Terran McCanna (tmccanna) → nobody
tags: added: signedoff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.