Skip to content

Commit

Permalink
fix(files_versions): renaming file version when its not a string
Browse files Browse the repository at this point in the history
Signed-off-by: Sanskar Soni <sanskarsoni300@gmail.com>
  • Loading branch information
sanskar-soni-9 authored and susnux committed Jun 19, 2024
1 parent 6a8d254 commit 2aecc52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/files_versions/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ function formatVersion(version: any, fileInfo: any): Version {

return {
fileId: fileInfo.id,
label: version.props['version-label'],
// If version-label is defined make sure it is a string (prevent issue if the label is a number an PHP returns a number then)
label: version.props['version-label'] && String(version.props['version-label']),
author: version.props['version-author'] ?? null,
filename: version.filename,
basename: moment(mtime).format('LLL'),
Expand Down

0 comments on commit 2aecc52

Please sign in to comment.