In the get_library BLOCK, upgrade any use of 'loc' to 'locg' instead of
trying to determine which to use in which situation. Before this change,
'loc' was being used as the loc_name for the main org unit selector,
which should always use 'locg'. For any other cases (related to search
params), it's always safe to use 'locg' over 'loc'.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
# Get the library or location group
# get_library()
+ # magically upgrades any use of 'loc' to 'locg',
+ # which is a superset of 'loc'.
BLOCK get_library;
- IF !loc_name;
- loc_name = 'loc';
- IF show_loc_groups; loc_name = 'locg'; END;
- END;
- IF !loc_value;
- loc_value = CGI.param('loc') || ctx.search_ou;
- IF show_loc_groups;
- loc_value = CGI.param('locg') || ctx.search_ou;
- END;
- END;
+ loc_name = 'locg';
+ loc_value = CGI.param(loc_name) || CGI.param('loc') || ctx.search_ou;
END;
%]