fix(legacy): sanitize track_type_id when updating file (#2003)

Fixes #2000
This commit is contained in:
Jonas L 2022-07-27 09:52:09 +02:00 committed by GitHub
parent e6d24333cb
commit f137be09a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -229,6 +229,12 @@ class Application_Model_StoredFile
if ($dbColumn == 'track_number' && empty($mdValue)) {
$mdValue = null;
}
// We need to set track_type_id to null if it is an empty string or 0
if ($dbColumn == 'track_type_id' && ($mdValue == 0 || empty($mdValue))) {
$mdValue = null;
}
$this->_file->{$method}($mdValue);
}
}