Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

[#43185] Show alert when storage is not added to any project

Frank Bergmann7609ba4ee3b1
diff --git a/modules/storages/app/services/storages/storages/create_service.rb b/modules/storages/app/services/storages/storages/create_service.rb
index e11a193786d..27646a440e4 100644
--- a/modules/storages/app/services/storages/storages/create_service.rb
+++ b/modules/storages/app/services/storages/storages/create_service.rb
@@ -39,11 +39,14 @@ module Storages::Storages
def after_perform(service_call)
super(service_call)
-
storage = service_call.result
+
+ # Automatically create an OAuthApplication object for the Nextcloud storage
+ # using values from storage (particularly :host) as defaults
if storage.provider_type == 'nextcloud'
persist_service_result = ::Storages::OAuthApplications::CreateService.new(storage:, user:).call
- service_call.add_dependent!(persist_service_result)
+ # Show errors in storage form, so use merge! instead of add_dependent
+ service_call.merge!(persist_service_result)
end
service_call