Browse Source

fix appstoreenabled check in Fetcher so it's coherent with AppSettingsController

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
tags/v23.0.0beta2
Julien Veyssier 2 years ago
parent
commit
facb50ebcc
No account linked to committer's email address

+ 1
- 1
apps/settings/lib/Controller/AppSettingsController.php View File

@@ -131,7 +131,7 @@ class AppSettingsController extends Controller {
public function viewApps(): TemplateResponse {
\OC_Util::addScript('settings', 'apps');
$params = [];
$params['appstoreEnabled'] = $this->config->getSystemValue('appstoreenabled', true) === true;
$params['appstoreEnabled'] = $this->config->getSystemValueBool('appstoreenabled', true);
$params['updateCount'] = count($this->getAppsWithUpdates());
$params['developerDocumentation'] = $this->urlGenerator->linkToDocs('developer-manual');
$params['bundles'] = $this->getBundles();

+ 2
- 2
apps/settings/tests/Controller/AppSettingsControllerTest.php View File

@@ -190,7 +190,7 @@ class AppSettingsControllerTest extends TestCase {
->willReturn(false);
$this->config
->expects($this->once())
->method('getSystemValue')
->method('getSystemValueBool')
->with('appstoreenabled', true)
->willReturn(true);
$this->navigationManager
@@ -224,7 +224,7 @@ class AppSettingsControllerTest extends TestCase {
$this->bundleFetcher->expects($this->once())->method('getBundles')->willReturn([]);
$this->config
->expects($this->once())
->method('getSystemValue')
->method('getSystemValueBool')
->with('appstoreenabled', true)
->willReturn(false);
$this->navigationManager

+ 2
- 2
lib/private/App/AppStore/Fetcher/Fetcher.php View File

@@ -90,7 +90,7 @@ abstract class Fetcher {
* @return array
*/
protected function fetch($ETag, $content) {
$appstoreenabled = $this->config->getSystemValue('appstoreenabled', true);
$appstoreenabled = $this->config->getSystemValueBool('appstoreenabled', true);
if ((int)$this->config->getAppValue('settings', 'appstore-fetcher-lastFailure', '0') > time() - self::RETRY_AFTER_FAILURE_SECONDS) {
return [];
}
@@ -148,7 +148,7 @@ abstract class Fetcher {
* @return array
*/
public function get($allowUnstable = false) {
$appstoreenabled = $this->config->getSystemValue('appstoreenabled', true);
$appstoreenabled = $this->config->getSystemValueBool('appstoreenabled', true);
$internetavailable = $this->config->getSystemValue('has_internet_connection', true);

if (!$appstoreenabled || !$internetavailable) {

Loading…
Cancel
Save