diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-02 14:36:16 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-02 14:36:16 +0200 |
commit | ed0c23a9cc49f10c741a84dc6c95e1dfef6ee61b (patch) | |
tree | a055c1da3e331e0b0f8603f6bf285aaa4141980a /lib/api.php | |
parent | 8a5e88b21cf95f8d0f964ee012f15e447644a10f (diff) | |
download | nextcloud-server-ed0c23a9cc49f10c741a84dc6c95e1dfef6ee61b.tar.gz nextcloud-server-ed0c23a9cc49f10c741a84dc6c95e1dfef6ee61b.zip |
fix bug that would only return error responses for 3rdparty apps
Diffstat (limited to 'lib/api.php')
-rw-r--r-- | lib/api.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api.php b/lib/api.php index 249d7a90350..8e4c3ef29b9 100644 --- a/lib/api.php +++ b/lib/api.php @@ -147,6 +147,7 @@ class OC_API { } } } + // Remove any error responses if there is one shipped response that succeeded if(!empty($shipped['succeeded'])) { $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']); @@ -157,14 +158,17 @@ class OC_API { // Maybe any that are not OC_API::RESPOND_SERVER_ERROR $response = reset($shipped['failed']); return $response; - } else { + } elseif(!empty($thirdparty['failed'])) { // Return the third party failure result $response = reset($thirdparty['failed']); return $response; + } else { + $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']); } // Merge the successful responses $meta = array(); $data = array(); + foreach($responses as $app => $response) { if(OC_App::isShipped($app)) { $data = array_merge_recursive($response->getData(), $data); |