diff --git a/dspace-xmlui/src/main/webapp/static/js/bitstream-ordering.js b/dspace-xmlui/src/main/webapp/static/js/bitstream-ordering.js index 5deed8f95e..085bd8373f 100644 --- a/dspace-xmlui/src/main/webapp/static/js/bitstream-ordering.js +++ b/dspace-xmlui/src/main/webapp/static/js/bitstream-ordering.js @@ -65,8 +65,8 @@ } orderElement.val(newOrder); - var upArrow = row.find('input[name$^="submit_order_"][name$="_up"]'); - var downArrow = row.find('input[name$^="submit_order_"][name$="_down"]'); + var upArrow = row.find('input[name^="submit_order_"][name$="_up"]'); + var downArrow = row.find('input[name^="submit_order_"][name$="_down"]'); //Check if we are the first row, if so hide the up arrow if(isBundleRow(row.prev())){ @@ -93,7 +93,11 @@ */ function isBundleRow(row){ // Checks if the identifier starts with the bundle head identifier - return row.attr("id").indexOf("aspect_administrative_item_EditItemBitstreamsForm_row_bundle_head_") == 0; + + //DS-2027, found error condition in which attribute is not set when reordering original bitstreams + var id = row.attr("id"); + if (id === undefined) return false; + return id.indexOf("aspect_administrative_item_EditItemBitstreamsForm_row_bundle_head_") == 0; }