aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb13
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties1
2 files changed, 10 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
index 008f76db170..b6a5ba9f4e2 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb
@@ -40,11 +40,16 @@ class ProfilesController < ApplicationController
require_parameters 'key'
call_backend do
@profile = Internal.qprofile_loader.getByKey(params[:key])
- not_found('Profile not found') unless @profile
- @deprecated_active_rules = Internal.qprofile_loader.countDeprecatedActiveRulesByProfile(@profile.getKey())
- @stats = Internal.qprofile_loader.getStatsByProfile(@profile.getKey())
+ if @profile
+ @deprecated_active_rules = Internal.qprofile_loader.countDeprecatedActiveRulesByProfile(@profile.getKey())
+ @stats = Internal.qprofile_loader.getStatsByProfile(@profile.getKey())
+ set_profile_breadcrumbs
+ else
+ # SONAR-5630
+ flash[:error] = message('quality_profiles.deleted_profile', :params => params[:key])
+ redirect_to :controller => 'profiles', :action => 'index'
+ end
end
- set_profile_breadcrumbs
end
# GET /profiles/create_form?language=<language>
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index 2f6077c178d..0a775d01a6c 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -1654,6 +1654,7 @@ quality_profiles.changelog.activated=Activated
quality_profiles.changelog.deactivated=Deactivated
quality_profiles.changelog.updated=Updated
quality_profiles.changelog.parameter_reset_to_default_value_x=Parameter <b>{0}</b> reset to default value
+quality_profiles.deleted_profile=The profile {0} doesn't exists anymore
#------------------------------------------------------------------------------