diff --git a/SQL/0000-00-00-schema.sql b/SQL/0000-00-00-schema.sql index 32b6db9c374..1d7c5bd681b 100644 --- a/SQL/0000-00-00-schema.sql +++ b/SQL/0000-00-00-schema.sql @@ -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`), diff --git a/modules/issue_tracker/php/edit.class.inc b/modules/issue_tracker/php/edit.class.inc index 73da2239e3d..ddeffe7b02d 100644 --- a/modules/issue_tracker/php/edit.class.inc +++ b/modules/issue_tracker/php/edit.class.inc @@ -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]);