Skip to content

Commit

Permalink
fix: Generate preview with proper aspect ratio for templates
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr committed Jan 14, 2025
1 parent d495a66 commit ba9c364
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Template/CollaboraTemplateProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getCustomTemplates(string $mimetype): array {

return array_map(function (File $file) {

Check failure on line 47 in lib/Template/CollaboraTemplateProvider.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis

InvalidReturnStatement

lib/Template/CollaboraTemplateProvider.php:47:10: InvalidReturnStatement: The inferred type 'array<array-key, OCP\Files\Template\Template>' does not match the declared return type 'array<array-key, OCP\Files\File>' for OCA\Richdocuments\Template\CollaboraTemplateProvider::getCustomTemplates (see https://psalm.dev/128)
$template = new Template(CollaboraTemplateProvider::class, (string)$file->getId(), $file);
$template->setCustomPreviewUrl($this->urlGenerator->linkToRouteAbsolute('richdocuments.templates.getPreview', ['fileId' => $file->getId()]));
$template->setCustomPreviewUrl($this->urlGenerator->linkToRouteAbsolute('richdocuments.templates.getPreview', ['fileId' => $file->getId(), 'a' => true]));
return $template;
}, $collaboraTemplates);
}
Expand Down

0 comments on commit ba9c364

Please sign in to comment.