Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files): more conversion tests and translate error messages #50240

Merged
merged 2 commits into from
Jan 18, 2025

Conversation

skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Jan 17, 2025

  • Translate displayed error messages
  • Prevent wrong extension
  • Reorder destination sanity checks
  • Add more integration tests

@skjnldsv skjnldsv force-pushed the fix/conversion-extension branch from a49a773 to abd3cb6 Compare January 17, 2025 17:23
@@ -72,14 +76,18 @@ public function convert(int $fileId, string $targetMimeType, ?string $destinatio
}

if (!$userFolder->get($parentDir)->isCreatable()) {
throw new OCSForbiddenException();
throw new OCSForbiddenException($this->l10n->t('You do not have permission to create a file at the specified location'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this shown on the frontend? If not then it makes no sense to translate if it is only for developers (also makes debugging harder)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is shown

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly not a HintException 😔

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition.

But regarding the errors: If they are not shown to the end user then do not translate them. It makes debugging of logs much harder (we had this discussion in other places recently).

@skjnldsv
Copy link
Member Author

regarding the errors: If they are not shown to the end user then do not translate them

image
😉

Co-authored-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: John Molakvoæ <[email protected]>
@skjnldsv skjnldsv merged commit 483e9e8 into master Jan 18, 2025
189 checks passed
@skjnldsv skjnldsv deleted the fix/conversion-extension branch January 18, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants