Merge pull request #8688 from nextcloud/13-8557
[stable13] Fix check if theming defaults instance is available
This commit is contained in:
commit
56d5eb17fe
|
@ -35,6 +35,7 @@
|
||||||
namespace OC;
|
namespace OC;
|
||||||
|
|
||||||
|
|
||||||
|
use OCA\Theming\ThemingDefaults;
|
||||||
use OCP\ICacheFactory;
|
use OCP\ICacheFactory;
|
||||||
use OCP\IConfig;
|
use OCP\IConfig;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
|
@ -170,7 +171,10 @@ class URLGenerator implements IURLGenerator {
|
||||||
$themingEnabled = $this->config->getSystemValue('installed', false) && \OCP\App::isEnabled('theming') && \OC_App::isAppLoaded('theming');
|
$themingEnabled = $this->config->getSystemValue('installed', false) && \OCP\App::isEnabled('theming') && \OC_App::isAppLoaded('theming');
|
||||||
$themingImagePath = false;
|
$themingImagePath = false;
|
||||||
if($themingEnabled) {
|
if($themingEnabled) {
|
||||||
$themingImagePath = \OC::$server->getThemingDefaults()->replaceImagePath($app, $image);
|
$themingDefaults = \OC::$server->getThemingDefaults();
|
||||||
|
if ($themingDefaults instanceof ThemingDefaults) {
|
||||||
|
$themingImagePath = $themingDefaults->replaceImagePath($app, $image);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) {
|
if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) {
|
||||||
|
|
Loading…
Reference in New Issue