]> source.dussan.org Git - nextcloud-server.git/commitdiff
display app update error messages - fixes #14611
authorThomas Müller <thomas.mueller@tmit.eu>
Wed, 11 Mar 2015 08:59:56 +0000 (09:59 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 11 Mar 2015 08:59:56 +0000 (09:59 +0100)
lib/private/installer.php
settings/js/apps.js

index 087bc6c1edbe5a8c648300e2ed84931d4959e40a..3956e503767b8bac231064e9e8b5b00bafdaf06b 100644 (file)
@@ -202,20 +202,21 @@ class OC_Installer{
 
        /**
         * update an app by it's id
-        * @param integer $ocsid
+        *
+        * @param integer $ocsId
         * @return bool
         * @throws Exception
         */
-       public static function updateAppByOCSId($ocsid) {
-               $appdata = OCSClient::getApplication($ocsid);
-               $download = OCSClient::getApplicationDownload($ocsid, 1);
+       public static function updateAppByOCSId($ocsId) {
+               $appData = OCSClient::getApplication($ocsId);
+               $download = OCSClient::getApplicationDownload($ocsId, 1);
 
                if (isset($download['downloadlink']) && trim($download['downloadlink']) !== '') {
                        $download['downloadlink'] = str_replace(' ', '%20', $download['downloadlink']);
                        $info = array(
                                'source' => 'http',
                                'href' => $download['downloadlink'],
-                               'appdata' => $appdata
+                               'appdata' => $appData
                        );
                } else {
                        throw new \Exception('Could not fetch app info!');
@@ -285,7 +286,7 @@ class OC_Installer{
         * @return array
         * @throws \Exception
         */
-       public static function checkAppsIntegrity($data = array(), $extractDir, $path, $isShipped=false) {
+       public static function checkAppsIntegrity($data, $extractDir, $path, $isShipped=false) {
                $l = \OC::$server->getL10N('lib');
                //load the info.xml file of the app
                if(!is_file($extractDir.'/appinfo/info.xml')) {
index c15d6a0f74d7c5c6e297a245c53bedab7d65d454..7330f426af72f992c5487a6198fda2d71e5c13de 100644 (file)
@@ -235,7 +235,11 @@ OC.Settings.Apps = OC.Settings.Apps || {
                OC.Settings.Apps.hideErrorMessage(appId);
                $.post(OC.filePath('settings','ajax','updateapp.php'),{appid:appId},function(result) {
                        if(!result || result.status !== 'success') {
-                               OC.Settings.Apps.showErrorMessage(appId, t('settings','Error while updating app'));
+                               if (result.data && result.data.message) {
+                                       OC.Settings.Apps.showErrorMessage(appId, result.data.message);
+                               } else {
+                                       OC.Settings.Apps.showErrorMessage(appId, t('settings','Error while updating app'));
+                               }
                                element.val(oldButtonText);
                        }
                        else {