]> source.dussan.org Git - nextcloud-server.git/commitdiff
Return failed shipped responses over succedded shipped responses
authortomneedham <tom@owncloud.com>
Thu, 14 Nov 2013 01:14:37 +0000 (01:14 +0000)
committertomneedham <tom@owncloud.com>
Thu, 14 Nov 2013 01:14:37 +0000 (01:14 +0000)
lib/private/api.php

index 76e00958a245ab54f1d25b36296d6501d369dd29..8ff6c3e7eeb5ce9cd8a672e207b2d6f4ab96c435 100644 (file)
@@ -159,15 +159,15 @@ 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']);
-               } else if(!empty($shipped['failed'])) {
+               if(!empty($shipped['failed'])) {
                        // Which shipped response do we use if they all failed?
                        // They may have failed for different reasons (different status codes)
                        // Which reponse code should we return?
                        // Maybe any that are not OC_API::RESPOND_SERVER_ERROR
                        $response = reset($shipped['failed']);
                        return $response['response'];
+               } elseif(!empty($shipped['succeeded'])) {
+                       $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']);
                } elseif(!empty($thirdparty['failed'])) {
                        // Return the third party failure result
                        $response = reset($thirdparty['failed']);