This patch ensures that the patron profile and
search OU values are retained when going from a patron
search to a single record and back to the patron search.
To test the fix for this bug:
[1] Search for a patron using the expanded patron search fields,
making sure to select values for the profile and search
OU dropdowns.
[2] Open a record, then click "Patron Search" to return to the
search form.
[3] Verify that the profile and search library are set and
that the same patron records are retrieved.
This patch includes elements from a patch originally written
by Victoria Lewis <vlewis@catalystitservices.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
var propagate;
if (patronSvc.lastSearch) {
propagate = patronSvc.lastSearch.search;
+ // home_ou needs to be treated specially
+ propagate.home_ou = {
+ value : patronSvc.lastSearch.home_ou,
+ group : 0
+ };
} else if (patronSvc.urlSearch) {
propagate = patronSvc.urlSearch.search;
}
// populate the search form with our cached / preexisting search info
angular.forEach(propagate, function(val, key) {
if (key == 'profile')
- val.value = $scope.profiles.filter(function(p) { p.id() == val.value })[0];
+ val.value = $scope.profiles.filter(function(p) { return p.id() == val.value })[0];
if (key == 'home_ou')
val.value = egCore.org.get(val.value);
$scope.searchArgs[key] = val.value;