From f152e0c08a02f6c1d81f562dc5c4ad56053efbf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 12 May 2015 09:21:09 +0200 Subject: [PATCH] [api] request "addrevision" option is using unexpanded revision when "updatelink" option is used --- ReleaseNotes-2.7 | 1 + src/api/app/models/bs_request_action.rb | 3 ++- src/api/test/functional/request_controller_test.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes-2.7 b/ReleaseNotes-2.7 index 6db53adf86f..f442e262794 100644 --- a/ReleaseNotes-2.7 +++ b/ReleaseNotes-2.7 @@ -38,6 +38,7 @@ Changes on purpose: * Users are allowed to add themself in their home project, even when they got removed. Admins should use the user state and set them to "locked" when they do want to block them. + * request "addrevision" option is using unexpanded revision when "updatelink" option is used Incompatible changes: ===================== diff --git a/src/api/app/models/bs_request_action.rb b/src/api/app/models/bs_request_action.rb index 112435445c0..a0421f998fb 100644 --- a/src/api/app/models/bs_request_action.rb +++ b/src/api/app/models/bs_request_action.rb @@ -924,7 +924,8 @@ def check_for_expand_errors!(add_revision) # validate that the sources are not broken begin - query = { expand: 1 } + query = {} + query[:expand] = "1" unless self.updatelink query[:rev] = self.source_rev if self.source_rev # FIXM2.4 we have a Directory model url = Package.source_path(self.source_project, self.source_package, nil, query) diff --git a/src/api/test/functional/request_controller_test.rb b/src/api/test/functional/request_controller_test.rb index 5b87850850e..92010fb90fd 100644 --- a/src/api/test/functional/request_controller_test.rb +++ b/src/api/test/functional/request_controller_test.rb @@ -2299,7 +2299,7 @@ def test_branch_and_submit_request_to_linked_project_and_delete_it_again SUBMIT " - post '/request?cmd=create', req + post '/request?cmd=create&addrevision=1', req assert_response :success assert_xml_tag(:tag => 'request') node = Xmlhash.parse(@response.body)