Skip to content

Commit

Permalink
MBS-9476: Fix missing update of timemodified
Browse files Browse the repository at this point in the history
  • Loading branch information
PhMemmel committed Dec 2, 2024
1 parent 0db9f97 commit 10cf50a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions classes/base_instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ final public function load(): void {
*/
final public function store(): void {
global $DB;
$clock = \core\di::get(\core\clock::class);
$record = new stdClass();
$record->name = $this->name;
$record->tenant = $this->tenant;
Expand All @@ -146,13 +147,14 @@ final public function store(): void {
$record->customfield3 = $this->customfield3;
$record->customfield4 = $this->customfield4;
$record->customfield5 = $this->customfield5;
$currenttime = $clock->time();
$record->timemodified = $currenttime;
if (is_null($this->record)) {
$record->timecreated = time();
$record->timecreated = $currenttime;
$record->id = $DB->insert_record('local_ai_manager_instance', $record);
$this->id = $record->id;
} else {
$record->id = $this->id;
$record->timemodified = time();
$DB->update_record('local_ai_manager_instance', $record);
}
$this->record = $record;
Expand Down

0 comments on commit 10cf50a

Please sign in to comment.