Skip to content

Commit 6175e5d

Browse files
Merge pull request #549 from nextcloud/backport-530-theming-autoloading-9
[stable9] Make sure we try to autoload the class
2 parents d2396b9 + 593608f commit 6175e5d

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

lib/private/server.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,13 @@ public function __construct($webRoot, \OC\Config $config) {
567567
return $factory->getManager();
568568
});
569569
$this->registerService('ThemingDefaults', function(Server $c) {
570-
if(class_exists('OCA\Theming\Template', false) && $this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) {
570+
try {
571+
$classExists = class_exists('OCA\Theming\Template');
572+
} catch (\OCP\AutoloadNotAllowedException $e) {
573+
// App disabled or in maintenance mode
574+
$classExists = false;
575+
}
576+
if ($classExists && $this->getConfig()->getSystemValue('installed', false) && $this->getAppManager()->isInstalled('theming')) {
571577
return new Template(
572578
$this->getConfig(),
573579
$this->getL10N('theming'),

lib/private/urlgenerator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
*/
3030

3131
namespace OC;
32-
use OC_Defaults;
32+
33+
3334
use OCP\ICacheFactory;
3435
use OCP\IConfig;
3536
use OCP\IURLGenerator;

0 commit comments

Comments
 (0)