]> source.dussan.org Git - nextcloud-server.git/commitdiff
Now showing disabled apps as upgrade status line
authorVincent Petry <pvince81@owncloud.com>
Tue, 27 May 2014 13:20:33 +0000 (15:20 +0200)
committerVincent Petry <pvince81@owncloud.com>
Tue, 27 May 2014 13:20:33 +0000 (15:20 +0200)
- Added app id in update overview.
- Added status message for disabled app for CLI upgrade and web upgrade

core/ajax/update.php
core/command/upgrade.php
core/templates/update.admin.php
lib/base.php
lib/private/app.php
lib/private/updater.php

index 55e8ab15ec22800be2aee0787a990577b21e2269..84d7a21209e4be4225776ab2e53d8e3fddcf90db 100644 (file)
@@ -15,6 +15,14 @@ if (OC::checkUpgrade(false)) {
        $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
                $eventSource->send('success', (string)$l->t('Updated database'));
        });
+       $updater->listen('\OC\Updater', 'disabledApps', function ($appList) use ($eventSource, $l) {
+               $list = array();
+               foreach ($appList as $appId) {
+                       $info = OC_App::getAppInfo($appId);
+                       $list[] = $info['name'] . ' (' . $info['id'] . ')';
+               }
+               $eventSource->send('success', (string)$l->t('Disabled incompatible apps: %s', implode(', ', $list)));
+       });
        $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource) {
                $eventSource->send('failure', $message);
                $eventSource->close();
index ed72d136e24b3c461dd4bcbafe029d80171b0065..8ce8ef9b6e5e4b9753bba37d6d2c1bb0c3f8e489 100644 (file)
@@ -56,6 +56,9 @@ class Upgrade extends Command {
                        $updater->listen('\OC\Updater', 'dbUpgrade', function () use($output) {
                                $output->writeln('<info>Updated database</info>');
                        });
+                       $updater->listen('\OC\Updater', 'disabledApps', function ($appList) use($output) {
+                               $output->writeln('<info>Disabled incompatible apps: ' . implode(', ', $appList) . '</info>');
+                       });
 
                        $updater->listen('\OC\Updater', 'failure', function ($message) use($output) {
                                $output->writeln($message);
index 0b1ae7854decb23d63410c8487a20b22502a1046..b9b0fdb77484be059e1947aab38ae8e4e70bb20a 100644 (file)
@@ -8,8 +8,8 @@
                <div class="section">
                        <div class="title bold"><?php p($l->t('The following apps will be disabled during the upgrade:')) ?></div>
                        <ul class="content appList">
-                       <?php foreach ($_['appList'] as $appName) { ?>
-                       <li><?php p($appName) ?></li>
+                       <?php foreach ($_['appList'] as $appInfo) { ?>
+                       <li><?php p($appInfo['name']) ?> (<?php p($appInfo['id']) ?>)</li>
                        <?php } ?>
                        </ul>
                </div>
index 455e8ad461333a91aa30069e84b244f4dc792f23..7bca1b7c87732e66530fc2b13db71e6f5b6f2a13 100644 (file)
@@ -298,7 +298,7 @@ class OC {
                                foreach ($apps as $appId) {
                                        $info = OC_App::getAppInfo($appId);
                                        if(!OC_App::isAppCompatible($version, $info)) {
-                                               $incompatibleApps[] = $info['name'];
+                                               $incompatibleApps[] = $info;
                                        }
                                }
                                $tmpl->assign('appList', $incompatibleApps);
index 50065197eb4ef395df2f8d68f55b38fde37e32f6..ea0453e58eaa47d63555f8d0d1db9e2bb93ba54a 100644 (file)
@@ -889,8 +889,14 @@ class OC_App{
         * ownCloud version. disable them if not.
         * This is important if you upgrade ownCloud and have non ported 3rd
         * party apps installed.
+        *
+        * @param array $apps optional app id list to check, uses all enabled apps
+        * when not specified
+        *
+        * @return array containing the list of ids of the disabled apps
         */
        public static function checkAppsRequirements($apps = array()) {
+               $disabledApps = array();
                if (empty($apps)) {
                        $apps = OC_App::getEnabledApps();
                }
@@ -905,8 +911,10 @@ class OC_App{
                                        OC_Log::ERROR);
                                OC_App::disable( $app );
                                OC_Hook::emit('update', 'success', 'Disabled '.$info['name'].' app because it is not compatible');
+                               $disabledApps[] = $app;
                        }
                }
+               return $disabledApps;
        }
 
        /**
index d8694ac6ed5dfdd37abf840f740714c7d59f4c8b..58d3cab73aa0a0e8ce65a4d9e5944d34a5fd76fc 100644 (file)
@@ -134,7 +134,10 @@ class Updater extends BasicEmitter {
                        $this->emit('\OC\Updater', 'failure', array($exception->getMessage()));
                }
                \OC_Config::setValue('version', implode('.', \OC_Util::getVersion()));
-               \OC_App::checkAppsRequirements();
+               $disabledApps = \OC_App::checkAppsRequirements();
+               if (!empty($disabledApps)) {
+                       $this->emit('\OC\Updater', 'disabledApps', array($disabledApps));
+               }
                // load all apps to also upgrade enabled apps
                \OC_App::loadApps();