Skip to content

Commit

Permalink
Improve check for showing user who locked profile
Browse files Browse the repository at this point in the history
  • Loading branch information
bwalkerl committed Dec 6, 2024
1 parent e0058c0 commit 2dce7a2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions classes/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,13 @@ public static function lock_display_modified($profile): string {
return '';
}

// We don't want to show user modified if it was set before the lock (i.e. during creation).
// We don't want to show user modified if it was set before the lock (i.e. during creation this is the profile user).
// No exact comparison, but can check it's different from created or greater than finished plus a small buffer.
if ($modified === $profile->get('timecreated') || ($profile->get('finished') + 10) > $modified) {
// If a profile is unfinished we need to use a larger buffer to check against modified.
$created = $profile->get('timecreated');
$finished = $profile->get('finished');
$completed = !empty($finished) ? $finished + 10 : $created + DAYSECS;
if ($modified === $created || $completed > $modified) {
return '';
}

Expand Down

0 comments on commit 2dce7a2

Please sign in to comment.