Indicia-Team/warehouse

Verification metadata inadvertantly updated

Closed this issue · 2 comments

In the warehouse user interface, edit an occurrence that has been verified. Without making any changes, click the save button.
The verifer and time of verification will be changed to the current user and current time.

This is caused by the line

if ($newStatus !== $this->record_status || $newSubstatus !== $this->record_substatus) {

where $newSubstatus is a string value while$this->record_substatus is an integer so they are never exactly equal.

In general, $newSubstatus can be null, int or string while $this->record_substatus can be null or int. To avoid errors, we should convert to string on both sides of the comparison.