From a649a0c4e3da949d9a613ddedc9ec620b59ca4cd Mon Sep 17 00:00:00 2001 From: Wieland Lindenthal Date: Fri, 7 Jun 2019 17:06:19 +0200 Subject: [PATCH] Adopt branch to upstream changes --- modules/bcf/app/controllers/bcf/issues_controller.rb | 4 ++-- modules/bcf/lib/open_project/bcf/bcf_xml/importer.rb | 4 ++-- modules/bcf/lib/open_project/bcf/bcf_xml/issue_reader.rb | 8 +++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/bcf/app/controllers/bcf/issues_controller.rb b/modules/bcf/app/controllers/bcf/issues_controller.rb index f292de7d4e..601e9e297a 100644 --- a/modules/bcf/app/controllers/bcf/issues_controller.rb +++ b/modules/bcf/app/controllers/bcf/issues_controller.rb @@ -167,7 +167,7 @@ module ::Bcf end def render_config_unknown_mails - @roles = Role.find_all_givable + @roles = Role.givable render 'bcf/issues/configure_unknown_mails' end @@ -176,7 +176,7 @@ module ::Bcf end def render_config_non_members - @roles = Role.find_all_givable + @roles = Role.givable render 'bcf/issues/configure_non_members' end diff --git a/modules/bcf/lib/open_project/bcf/bcf_xml/importer.rb b/modules/bcf/lib/open_project/bcf/bcf_xml/importer.rb index 2fe7e39749..6ef368c3cb 100644 --- a/modules/bcf/lib/open_project/bcf/bcf_xml/importer.rb +++ b/modules/bcf/lib/open_project/bcf/bcf_xml/importer.rb @@ -88,7 +88,7 @@ module OpenProject::Bcf::BcfXml def add_unknown_mail(mail, options) user = UserInvitation.invite_new_user(email: mail) - member = Member.create(user: user, + member = Member.create(principal: user, project: project) membership_service = ::Members::EditMembershipService.new(member, save: true, @@ -97,7 +97,7 @@ module OpenProject::Bcf::BcfXml end def add_non_member(user, options) - member = Member.create(user: user, + member = Member.create(principal: user, project: project) membership_service = ::Members::EditMembershipService.new(member, save: true, diff --git a/modules/bcf/lib/open_project/bcf/bcf_xml/issue_reader.rb b/modules/bcf/lib/open_project/bcf/bcf_xml/issue_reader.rb index e2282aecfe..09b2b37aac 100644 --- a/modules/bcf/lib/open_project/bcf/bcf_xml/issue_reader.rb +++ b/modules/bcf/lib/open_project/bcf/bcf_xml/issue_reader.rb @@ -108,11 +108,9 @@ module OpenProject::Bcf::BcfXml end def create_work_package - wp = WorkPackage.new work_package_attributes - - call = CreateWorkPackageService - .new(user: user) - .call(wp, send_notifications: false) + call = WorkPackages::CreateService.new(user: user).call(work_package_attributes + .merge(send_notifications: false) + .symbolize_keys) if call.success? force_overwrite(wp)