Skip to content

Commit

Permalink
Merge pull request #2827 from Leantime/editSettingsIssue
Browse files Browse the repository at this point in the history
Fix missing value submission for notifications checkbox #2818
  • Loading branch information
marcelfolaron authored Nov 26, 2024
2 parents ce89ded + 5b8641f commit 39e9460
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 415 deletions.
3 changes: 2 additions & 1 deletion app/Domain/Users/Controllers/EditOwn.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ public function post(): Response
];

if (password_verify($_POST['currentPassword'], $values['password'])) {

if ($_POST['newPassword'] == $_POST['confirmPassword']) {
if ($this->userService->checkPasswordStrength($_POST['newPassword'])) {
$values['password'] = $_POST['newPassword'];
Expand Down Expand Up @@ -307,7 +308,7 @@ public function post(): Response
$this->userRepo->editOwn($values, $this->userId);

// Storing option messagefrequency
$this->settingsService->saveSetting('usersettings.'.$this->userId.'.messageFrequency', (int) $_POST['messagesfrequency']);
$this->settingsService->saveSetting('usersettings.'.$this->userId.'.messageFrequency', (int) $_POST['messagesfrequency'] ?? 3600);

$this->tpl->setNotification($this->language->__('notifications.changed_profile_settings_successfully'), 'success', 'profilesettings_updated');
}
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Users/Templates/editOwn.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
<div class="form-group">
<label for="notifications" >{{ __('label.receive_notifications') }}</label>
<span>
<input type="checkbox" value="" name="notifications" class="input"
<input type="checkbox" value="on" name="notifications" class="input"
id="notifications"
@if ($values['notifications'] == "1" )
checked='checked'
Expand Down
Loading

0 comments on commit 39e9460

Please sign in to comment.