From 7061f6a57068243ed10f632857fbf374a757f300 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Wed, 21 May 2014 12:19:27 -0400 Subject: [PATCH] FIX: displayErrors is undefined in flags.js controller --- app/assets/javascripts/discourse/controllers/flag.js.es6 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/flag.js.es6 b/app/assets/javascripts/discourse/controllers/flag.js.es6 index e7cbfff6e54..6df825a917c 100644 --- a/app/assets/javascripts/discourse/controllers/flag.js.es6 +++ b/app/assets/javascripts/discourse/controllers/flag.js.es6 @@ -90,8 +90,12 @@ export default Discourse.ObjectController.extend(Discourse.ModalFunctionality, { postAction.act(params).then(function() { self.send('closeModal'); }, function(errors) { - self.send('showModal'); - self.displayErrors(errors); + self.send('closeModal'); + if (errors && errors.responseText) { + bootbox.alert($.parseJSON(errors.responseText).errors); + } else { + bootbox.alert(I18n.t('generic_error')); + } }); },