Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IssueTracker] Fix for "othersWatching" history tracking #8875

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ CREATE TABLE `issues_history` (
`issueHistoryID` int(11) unsigned NOT NULL AUTO_INCREMENT,
`newValue` longtext NOT NULL,
`dateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`fieldChanged` enum('assignee','status','comment','sessionID','centerID','title','category','module','lastUpdatedBy','priority','candID') NOT NULL DEFAULT 'comment',
`fieldChanged` enum('assignee','status','comment','sessionID','centerID','title','category','module','lastUpdatedBy','priority','candID','watching') NOT NULL DEFAULT 'comment',
`issueID` int(11) unsigned NOT NULL,
`addedBy` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`issueHistoryID`),
Expand Down
11 changes: 10 additions & 1 deletion modules/issue_tracker/php/edit.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,16 @@ class Edit extends \NDB_Page implements ETagCalculator
}

// Get changed values to save in history
$historyValues = $this->getChangedValues($issueValues, $issueID, $user);
$issueValuesWithWatching = $issueValues;
if (isset($values['othersWatching'])) {
$usersWatching = $values['othersWatching'];
$issueValuesWithWatching['watching'] = $usersWatching;
}
$historyValues = $this->getChangedValues(
$issueValuesWithWatching,
$issueID,
$user
);

if (!empty($issueID)) {
$db->update('issues', $issueValues, ['issueID' => $issueID]);
Expand Down
Loading