]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix bug that would only return error responses for 3rdparty apps
authorBernhard Posselt <nukeawhale@gmail.com>
Thu, 2 May 2013 12:36:16 +0000 (14:36 +0200)
committerBernhard Posselt <nukeawhale@gmail.com>
Thu, 2 May 2013 12:36:16 +0000 (14:36 +0200)
lib/api.php

index 249d7a903508d64075fea0d9b6c8b34d50d3f192..8e4c3ef29b9a8d2a009de928c21b6fc897e0de2b 100644 (file)
@@ -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);