Skip to content
Open
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
12 changes: 5 additions & 7 deletions lib/private/Repair/RepairMimeTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,11 @@ public function migrationsAvailable(): bool {
* Get the current mimetype version
*/
private function getMimeTypeVersion(): string {
$serverVersion = $this->config->getSystemValueString('version', '0.0.0');
// 29.0.0.10 is the last version with a mimetype migration before it was moved to a separate version number
if (version_compare($serverVersion, '29.0.0.10', '>')) {
return $this->appConfig->getValueString('files', 'mimetype_version', '29.0.0.10');
}

return $serverVersion;
// 29.0.0.10 is the last version with a mimetype migration before tracking was moved to mimetype_version.
// However since it's possible that someone may have upgraded without running expensive repair steps prior
// to 29.0.0.10, we assume none have been ran (once). This is acceptable since (a) only happens when expensive
// repair steps are explicitly requested; (b) only happens once *ever* in a given environment.
return $this->appConfig->getValueString('files', 'mimetype_version', '0.0.0');
}

/**
Expand Down
4 changes: 4 additions & 0 deletions lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,10 @@ public function install(array $options, ?IOutput $output = null): array {
}
}

// Seed the mimetype_version for future mimetype repair jobs with the install-time version
$serverVersion = $config->getSystemValueString('version', '0.0.0');
$appConfig->setValueString('files', 'mimetype_version', $serverVersion);

// Dispatch installation completed event
$adminUsername = !$disableAdminUser ? ($options['adminlogin'] ?? null) : null;
$adminEmail = !empty($options['adminemail']) ? $options['adminemail'] : null;
Expand Down
Loading