From 7219873f2d04335b2a845ad29e099dc8435fc7a3 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 11 Oct 2012 19:26:02 +0000 Subject: [PATCH] fix issue rendering error git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1397247 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-webapp-js/src/main/webapp/js/archiva/search.js | 2 +- .../archiva-webapp-js/src/main/webapp/js/archiva/utils.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index f6638c83a..24a0d152e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -233,7 +233,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno displaySuccessMessage( $.i18n.prop('artifact.deleted')); }, error:function(data){ - displayRestError(data,"user-messages"); + displayRestError( data,"user-messages"); }, complete:function(){ closeDialogConfirm(); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 6f62e1147..8e17df8f8 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -287,6 +287,10 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) { */ displayRestError=function(data,idToAppend){ $.log("displayRestError"); + // maybe data is just the response so test if if we have a responseText and transform it to json + if(data.responseText){ + data= $.parseJSON(data.responseText); + } if (data.redbackRestError){ displayRedbackError(archivaRestError,idToAppend) } -- 2.39.5