-
Notifications
You must be signed in to change notification settings - Fork 119
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
Islandora tokens 1171 pt2 #845
Islandora tokens 1171 pt2 #845
Conversation
0038032
to
d9af78f
Compare
islandora.tokens.inc
Outdated
if (!is_null($fid_value)) { | ||
$file = File::load($fid_value); | ||
if ($file) { | ||
$url = $file->getFileUri(); |
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.
This returns files with a protocol of public://
or fedora://
, which can't be de-referenced from the outside. There's a function is IslanodraUtils you can use to get the download url of the file.
$url = $islandora_utils->getDownloadUrl($file);
should do the trick.
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.
Confirmed, it definitely does the trick. Make that change and this goes in 🚀 🙇♂️
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.
getDownloadUrl replaced the previous code
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.
Awesome. Thanks @wgilling 🙇♂️
GitHub Issue: (Islandora/documentation#1171)
Release pull requests, etc.)
What does this Pull Request do?
This should complete the redistribution of all the tokens that were previously in the two distinct "islandora_tokens" modules (by @kayakr and @wgilling). Since this branch was once merged to islandora already, this new PR is to address the last change to islandora module to provide the
pdf_url
token. After this is merged, the full set of tokens would be available as part of islandora or the controlled_access_terms module (separate code repo and PR for that).This PR moves all tokens that needed Media or File functionality into the islandora module.
What's new?
There should be no side-effects. If the instance of controlled_access_terms is not up to date, this PR may cause a conflict as to which module provides the functionality for this
pdf_url
token.pdf_url
token to islandora/islandora.tokens.incpdf_url
token has already been removed from the controlled_access_terms/controlled_access_terms.tokens.inc(i.e. Regeneration activity, etc.)? clear the cache after pulling down the code
How should this be tested?
pdf_url
tokenA description of what steps someone could take to:
Interested parties
@dannylamb, @Islandora/8-x-committers