Bug 25615: Remove empty entries in the filter dropdowns of "holds to pull"
On the "Holds to pull" view there are filters that are built on the value of the cells. Bug 22536 improved the ergonomic by adding a ul list, but the filters are now broken, the ul and li tags are retrieved and put in the filter list. The idea of this patch is to remove the HTML tags and skip if the value is then empty. Test plan: Place a hold on an item Go to Home › Circulation › Holds to pull Open the "libraries" filter => Without this patch you see empty entries => With this patch the filter contain only the libraries Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (cherry picked from commit4f70682c56) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit58c071fad3) Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> (cherry picked from commitd680ae35f3) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
parent
525ca46cc7
commit
2ddae7366c
|
|
@ -275,8 +275,11 @@
|
|||
function createSelect( data ) {
|
||||
data = separateData(data);
|
||||
var r='<select style="width:99%"><option value="">' + _("None") + '</option>', i, len=data.length;
|
||||
var regex = /(<([^>]+)>)/ig; // Remove html tags
|
||||
for ( i=0 ; i<len ; i++ ) {
|
||||
r += '<option value="'+data[i]+'">'+data[i]+'</option>';
|
||||
var cell_val = data[i].replace(regex, '');
|
||||
if ( cell_val.length < 1 ) continue;
|
||||
r += '<option value="'+cell_val+'">'+cell_val+'</option>';
|
||||
}
|
||||
return r+'</select>';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue