-
Notifications
You must be signed in to change notification settings - Fork 54
Fix path to image resources #1106
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
Author
|
/compile amend / |
Member
Author
|
/backport to stable30 |
Member
Author
|
/backport to stable29 |
Member
Author
|
/backport to stable28 |
2702111 to
cc82741
Compare
cc82741 to
81fb907
Compare
Collaborator
When "./js/pdfjs/web/images/" is resolved and pretty URLs are enabled
the result is "{SERVER}/apps/files_pdfviewer/js/pdfjs/web/images/",
which works as expected. However, if pretty URLs are not enabled the
absolute path becomes
"{SERVER}/index.php/apps/files_pdfviewer/js/pdfjs/web/images/" instead.
As the images are static files they are not served by "index.php", so
they can not be found and therefore are not rendered in the PDF.
To solve that now the path is generated in PHP and provided through the
template, similarly to how it is done, for example, for the path to the
cmap files.
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
81fb907 to
343adfc
Compare
szaimen
approved these changes
Jan 16, 2025
Collaborator
szaimen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works :)
Collaborator
This was referenced Jan 16, 2025
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Follow up to #689
When
./js/pdfjs/web/images/is resolved and pretty URLs are enabled the result is{SERVER}/apps/files_pdfviewer/js/pdfjs/web/images/, which works as expected. However, if pretty URLs are not enabled the absolute path becomes{SERVER}/index.php/apps/files_pdfviewer/js/pdfjs/web/images/instead. As the images are static files they are not served byindex.php, so they can not be found and therefore are not rendered in the PDF.To solve that now the path is generated in PHP and provided through the template, similarly to how it is done, for example, for the path to the cmap files.
How to test
htaccess.RewriteBasefrom config.php withocc config:system:delete htaccess.RewriteBaseand then updating .htaccess withocc maintenance:update:htaccessResult with this pull request
The note icon is shown in the annotation of the PDF
Result without this pull request
The note icon is not shown in the annotation of the PDF