diff --git a/app/assets/javascripts/admin/util.js.erb b/app/assets/javascripts/admin/util.js.erb
index c689ab8307..93f1c50a64 100644
--- a/app/assets/javascripts/admin/util.js.erb
+++ b/app/assets/javascripts/admin/util.js.erb
@@ -12,3 +12,19 @@ $(document).ready(function() {
stepMinute: 15
});
});
+
+// Overriding a broken function in Spree. Bug report at
+// https://github.com/spree/spree/issues/4032
+show_flash_error = function(message) {
+ error_div = $('.flash.error');
+ if (error_div.length > 0) {
+ error_div.html(message);
+ error_div.show();
+ } else {
+ if ($("#content .toolbar").length > 0) {
+ $("#content .toolbar").before('
' + message + '
');
+ } else {
+ $("#progress").before('' + message + '
');
+ }
+ }
+}
diff --git a/app/views/spree/admin/shared/_destroy.js.erb b/app/views/spree/admin/shared/_destroy.js.erb
deleted file mode 100644
index 0dfb8de34b..0000000000
--- a/app/views/spree/admin/shared/_destroy.js.erb
+++ /dev/null
@@ -1,17 +0,0 @@
-notice_div = $('.flash.notice');
-<% notice = flash.discard(:notice)
-if notice %>
- if (notice_div.length > 0) {
- notice_div.html("<%= notice %>");
- notice_div.show();
- } else {
- if ($("#content .toolbar").length > 0) {
- $("#content .toolbar").before('<%= notice %>
');
- } else {
- $("#progress").before('<%= notice %>
');
- }
- } <%
-end %>
-
-<%= render :partial => '/spree/admin/shared/update_order_state' if @order %>
-