Skip to content

Calling "occ update:check" generate an error "Call to undefined method OC\Server::getRootFolder()" #238

@dominiquefournier

Description

@dominiquefournier

Describe the bug
Calling "occ update:check" generate an error "Call to undefined method OC\Server::getRootFolder()"

The corresponding line is apps/carnet/lib/AppInfo/Application.php:28 :

    public function __construct(array $urlParams=array()){
        parent::__construct('carnet', $urlParams);
        $container = $this->getContainer();
        $container->registerService('Config', function($c) {

            return $c->query('ServerContainer')->getConfig();
        });

        $container->registerService('RootFolder', function($c) {

            return $c->query('ServerContainer')->getRootFolder();    // <<<<<<<=====
        });
        $container->registerService('UserManager', function($c) {
            return $c->query('ServerContainer')->getUserManager();
        });
    }

To Reproduce
Steps to reproduce the behavior:

  1. connect to your nextcloud
  2. request the update check with : /usr/bin/su - NEXTCLOUDUSER -s /bin/bash -c "php /var/www/html/nextcloud/occ update:check"
  3. See the error

Expected behavior
Should not use getRootFolder as it doesn't exists anymore

** Server version
Uptodate Nextcloud 34.0.0.
Uptodate Carnet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions