Fix Tilepic viewer path resolution using configured media paths#1934
Open
atnjqt wants to merge 1 commit into
Open
Fix Tilepic viewer path resolution using configured media paths#1934atnjqt wants to merge 1 commit into
atnjqt wants to merge 1 commit into
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
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.
Summary
Fix
viewers/apps/tilepic.phpso Tilepic viewer tiles are resolved using the configured media path settings rather than legacy path inference from the script/request path.This fixes image representation overlays that render as a black viewer with controls visible when the underlying
.tpctile file is stored under a configured media root outside the web app directory.Problem
In Providence, image representations can open into the Tilepic viewer overlay, but the viewer remains blank/black even though:
The root cause is that
viewers/apps/tilepic.phpattempted to infer the filesystem path to the.tpcfile from the incoming URL and script location. That works only for certain directory layouts.In deployments where media is configured outside the web root/app tree, for example:
the tile endpoint can fail to locate the tilepic file and returns:
As a result, the browser receives no tile images and the overlay stays black.
What this PR changes
This PR updates
viewers/apps/tilepic.phpto resolve tilepic files using the configured media settings fromapp/conf/global.conf:ca_media_url_rootca_media_root_dirIt now derives candidate filesystem paths from those config values instead of relying on legacy script-path reconstruction.
Why this approach
CollectiveAccess already has explicit configuration for:
Using those settings is more reliable than inferring paths from the runtime location of
tilepic.php.This is especially important for installations where:
Reproduction
Using a deployment with media configured outside the app tree:
Before this change, the response is: