-
Notifications
You must be signed in to change notification settings - Fork 51
Tokens not working in URLs #455
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
Conversation
|
Note that this PR fixes issue #469 |
|
While testing this PR, I get the following fatal error when I visit |
|
i made a PR that fixes this and it has been merged on master. i think you can safely ignore assuming theres not a commit that reverts it in this pr. #458 |
|
(I meant to add the following comment here but went to another issue by mistake oops!) Ok I reviewed your PR against this and I don't see the issue being reintroduced. Merging this to master should not revert the PR made by @bradfordcondon 👍 |
|
Ok, Added the Reviewer #1 Approval tag for @almasaeed2010's review --Thanks! One more review required before merge... |
|
Code looks good to me. I followed your example (replacing mrna with gene in the url) and the job ran successfully. |
|
NONE of the URL aliases work on my site. We checked my url_alias table and it looks good there. Since @almasaeed2010 has functional confirmation, and the code looks good to me, i'm going to aprove given our discussion re: number of required functional tests. |
|
That's odd the URLs didn't work for you and warrants investigation if you have time. Thanks for merging. |
Issue #452 and #355
Type(s) of Change(s)
Description
There were two problems with using tokens in URLs.
First, the tokens were not "deep" enough. For example, when setting the URL for a gene or mRNA content type you had available the [obi__organism] token but that was it! There was nothing for the genus and species. If you used it then it an empty string would be substituted for the token. This pull request fixes that problem. Now, the tokens reference the sub elements of a field so we now have tokens for genus and species. Tokens should exist for any field that has sub elements and those elements are defined in the elementInfo() function of the field.
Second, non alphanumeric characters were being rewritten as underscores. That causes problems with migrating from Tv2 aliases.
Finally, I fixed a typo in the TripalJob class that I discovered while testing this fix. It was preventing me from re-running jobs. Just take a look at the code below and you'll see the problem. The if statement tries to evaluate the $path but it is set in the line below:
tripal/tripal/includes/TripalJob.inc
Lines 161 to 165 in 50270e6
Testing
The easiest test is to edit the gene content type and set the URL alias to this:
mRNA/[obi__organism,TAXRANK:0000005]/[obi__organism,TAXRANK:0000006]/[data__identifier]Before using that URL string, check the 'Available Tokens' to make sure you see the tokens used in the string above.
It will take time to update your URLs if you have thousands of records. So, testing on a small site or different content type would go fastest.
Screenshots (if appropriate):
Additional Notes (if any):