Skip to content

Commit

Permalink
Fix UpdateSteps Session_reminder duplicate Key
Browse files Browse the repository at this point in the history
  • Loading branch information
fhelfer authored and kergomard committed Oct 23, 2024
1 parent d2837f9 commit 658414a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function __construct(
ilIniFile $clientIni,
ilLogger $logger,
ClockInterface $utcClock,
private ilSetting $settings
) {
$this->http = $http;
$this->refinery = $refinery;
Expand Down
1 change: 0 additions & 1 deletion components/ILIAS/Authentication/resources/sessioncheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
$DIC['ilClientIniFile'],
$DIC->logger()->auth(),
(new DataFactory())->clock()->utc(),
$DIC->settings()
)
)->handle()
);
Expand Down
15 changes: 8 additions & 7 deletions components/ILIAS/User/src/Setup/DBUpdateSteps10.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@ public function step_3(): void
['common', 'session_reminder_enabled']
);
$session_reminder = $result->numRows() ? (bool) $this->db->fetchAssoc($result)['value'] : false;
if ($session_reminder) {
$query = 'SELECT * FROM settings WHERE module = %s AND keyword = %s';
$result = $this->db->queryF(
$query,
[\ilDBConstants::T_TEXT, \ilDBConstants::T_TEXT],
['common', 'session_reminder_lead_time']
);
$session_reminder_lead_time = $result->numRows() ? (int) $this->db->fetchAssoc($result)['value'] : null;
if ($session_reminder && !isset($session_reminder_lead_time)) {
$query = 'INSERT INTO settings (module, keyword, value) VALUES (%s, %s, %s)';
$this->db->manipulateF(
$query,
Expand All @@ -103,11 +110,5 @@ public function step_3(): void
['common', 'session_reminder_enabled']
);
}
$query = 'INSERT INTO settings (module, keyword, value) VALUES (%s, %s, %s)';
$this->db->manipulateF(
$query,
[\ilDBConstants::T_TEXT, \ilDBConstants::T_TEXT, \ilDBConstants::T_INTEGER],
['common', 'session_reminder_lead_time', \ilSessionReminder::LEAD_TIME_DISABLED]
);
}
}

0 comments on commit 658414a

Please sign in to comment.