Fix photo viewer in public shared Maps by passing shareToken to Viewer#1437
Open
Fix photo viewer in public shared Maps by passing shareToken to Viewer#1437
Conversation
Co-authored-by: tacruc <402891+tacruc@users.noreply.github.com>
Co-authored-by: tacruc <402891+tacruc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [Bug]: Photos on public shared Maps cannot be displayed
Fix photo viewer in public shared Maps by passing shareToken to Viewer
Aug 4, 2025
tacruc
approved these changes
Aug 6, 2025
tacruc
approved these changes
Aug 6, 2025
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
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.
When viewing photos on a publicly shared Maps instance, clicking on photo previews would fail with 401 Unauthorized errors:
The issue occurred because the Viewer component was being called without the public share context, causing it to attempt file access using standard user-based DAV paths instead of public share paths.
Root Cause:
The
OCA.Viewer.open()calls in photo-related components were not passing the share token when in a public share context. This resulted in the Viewer trying to construct URLs likeremote.php/dav/files/undefined/...instead of the correct public share formatpublic.php/dav/files/{token}/....Solution:
Modified the photo viewer methods to detect public share context using
getToken()and pass theshareTokenparameter to the Viewer when appropriate:Components Updated:
PhotosLayer.vue: UpdatedviewPhotoanddisplayClustermethodsPhotoSuggestionsLayer.vue: UpdatedviewPhotoanddisplayClustermethodsPhotoSuggestionsSidebarTab.vue: UpdatedonListItemClickmethodThis fix follows the same pattern already used successfully in the
getPreviewUrlmethod for photo thumbnails, ensuring consistency across the codebase. The behavior for logged-in users remains unchanged.Fixes #1436.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.