Skip to content

Commit 1c3621c

Browse files
committed
Couple small bugfixes
1 parent 5539b97 commit 1c3621c

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

app/controllers/BaseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function initialize()
2525
{
2626
$this->settings = $this->di->get('settings');
2727

28-
if (in_array($this->dispatcher->getControllerName(), $this->controllersToLoadMenu))
28+
if ($this->di->has('db') && in_array($this->dispatcher->getControllerName(), $this->controllersToLoadMenu))
2929
{
3030
if ($this->session->get('auth'))
3131
{

app/forms/formfields/dashboard/CouchpotatoFormFields.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@ protected function initializeFields()
5959
->setFilters(['striptags', 'string'])
6060
->setAttributes(['class' => 'form-control', 'fieldset' => true])
6161
->setDefault($this->form->settings->couchpotato->tmdb_api_url)
62-
->addValidator(new UrlValidator(['message' => $this->form->translator->validation['url']]));
62+
->addValidators([
63+
new UrlValidator(['message' => $this->form->translator->validation['url'], 'allowEmpty' => true]),
64+
new PresenceOfConfirmation(['message' => $this->form->translator->validation['required'], 'with' => 'couchpotato-enabled'])
65+
]);
6366

6467
$this->fields[] = $tmdbAPIKey = new Password('couchpotato-tmdb_api_key');
6568
$tmdbAPIKey->setLabel('TMDB API key')
6669
->setFilters(['striptags', 'string'])
6770
->setAttributes(['class' => 'form-control', 'fieldset' => 'end'])
68-
->setDefault($this->form->settings->couchpotato->tmdb_api_key);
71+
->setDefault($this->form->settings->couchpotato->tmdb_api_key)
72+
->addValidators([
73+
new PresenceOfConfirmation(['message' => $this->form->translator->validation['required'], 'with' => 'couchpotato-enabled'])
74+
]);
6975
}
7076
}

app/forms/formfields/dashboard/JellyfinFormFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected function initializeFields()
6969
'class' => 'form-control',
7070
'multiple' => 'multiple',
7171
'fieldset' => 'end',
72-
'data-selected' => $this->form->settings->jellyfin->views,
72+
'data-selected' => $this->form->settings->jellyfin->views ?? '',
7373
'data-apiurl' => '../jellyfin/views'
7474
])
7575
->setUserOptions(['buttons' => ['refresh_api_data']]);

app/forms/formfields/dashboard/PulsewayFormFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function initializeFields()
7070
'multiple' => 'multiple',
7171
'fieldset' => 'end',
7272
'disabled' => true,
73-
'data-selected' => $this->form->settings->pulseway->systems,
73+
'data-selected' => $this->form->settings->pulseway->systems ?? '',
7474
'data-apiurl' => '../pulseway/systems'
7575
])
7676
->setUserOptions(['buttons' => ['refresh_api_data']]);

app/forms/formfields/dashboard/SpeedtestFormFields.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ protected function initializeFields()
5858
$this->fields[] = $speedtestGetIP = new Check('speedtest-get_isp_info');
5959
$speedtestGetIP->setLabel('Get ISP IP');
6060
$speedtestGetIP->setAttributes([
61+
'value' => '1',
6162
'checked' => $this->form->settings->speedtest->get_isp_info == '1' ? 'checked' : null,
6263
'data-toggle' => 'toggle',
6364
'data-onstyle' => 'success',

js/dashboard-blocks/phpsysinfo.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,17 @@
295295
block.find(".update .packages .value").html(packages);
296296
block.find(".update .security .value").html(security);
297297

298-
if (count > 0) {
298+
if (count > 0 && settings.setBadges) {
299299
//todo: handle the error with .catch((error)
300300
navigator.setAppBadge(count);
301301
return;
302302
}
303303
}
304304

305305
//todo: handle the error with .catch((error)
306-
navigator.clearAppBadge();
306+
if (settings.setBadges) {
307+
navigator.clearAppBadge();
308+
}
307309
},
308310

309311
/**

0 commit comments

Comments
 (0)