Skip to content
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

Fedora URI pseudofield doesn't work on Taxonomy Terms #1288

Closed
rosiel opened this issue Sep 29, 2019 · 10 comments
Closed

Fedora URI pseudofield doesn't work on Taxonomy Terms #1288

rosiel opened this issue Sep 29, 2019 · 10 comments

Comments

@rosiel
Copy link
Member

rosiel commented Sep 29, 2019

The Fedora URI (or Gemini URI, depending on which part of the interface you're in) can be configured to show up on Taxonomy Terms. However, it does not display.

I am looking, for example, at the built-in terms that come with the playbook, e.g. Software (part of Resource Types), which in my box is at /taxonomy/term/12.

In Gemini, via SQL, i can verify that it has a Fedora URI.

However, despite

  • configuring this vocabulary to have the Gemini URI enabled,
  • confirming that the Fedora URI is visible in Manage Display,

No Fedora URI appears.

In my Drupal Recent Log Messages, there is a 'Gemini findByURI 404 response'.

@rosiel rosiel changed the title Fedora URI doesn't work on Taxonomy Terms Fedora URI pseudofield doesn't work on Taxonomy Terms Sep 29, 2019
@seth-shaw-unlv
Copy link
Contributor

(Going off the top of my head, need to verify this theory.) This is probably due to how we use field_external_uri. Taxonomy terms that use that field would be known by their external URI rather than the Drupal URI which is what we use to query Gemini; thus Gemini is just shrugging. We probably need the bit of code that does the Gemini lookup to check for the presence of external_uri and use that value instead.

@seth-shaw-unlv
Copy link
Contributor

Nope. Scratch that theory; and I should have read your ticket description more carefully.

@dannylamb
Copy link
Contributor

dannylamb commented Sep 30, 2019

I recreated this and from the Gemini logs it looks like an authentication issue:

[2019-09-30 09:49:20] app.INFO: Matched route "{route}". {"route":"GET_by_uri","route_parameters":{"_controller":"gemini.controller:getByUri","_route":"GET_by_uri"},"request_uri":"http://127.0.0.1:8000/gemini/by_uri","method":"GET"} []
[2019-09-30 09:49:20] app.DEBUG: Checking for guard authentication credentials. {"firewall_key":"default","authenticators":1} []
[2019-09-30 09:49:20] app.DEBUG: Checking support on guard authenticator. {"firewall_key":"default","authenticator":"Islandora\\Crayfish\\Commons\\Syn\\JwtAuthenticator"} []
[2019-09-30 09:49:20] app.DEBUG: Calling getCredentials() on guard authenticator. {"firewall_key":"default","authenticator":"Islandora\\Crayfish\\Commons\\Syn\\JwtAuthenticator"} []
[2019-09-30 09:49:20] crayfish.syn.jwt_authentication.INFO: Token missing [] []
[2019-09-30 09:49:20] app.INFO: An AuthenticationException was thrown; redirecting to authentication entry point. {"exception":"[object] (Symfony\\Component\\Security\\Core\\Exception\\AuthenticationCredentialsNotFoundException(code: 0): A Token was not found in the TokenStorage. at /var/www/html/Crayfish/Gemini/vendor/symfony/security/Http/Firewall/AccessListener.php:51)"} []
[2019-09-30 09:49:20] app.DEBUG: Calling Authentication entry point. [] []
[2019-09-30 09:49:20] app.DEBUG: < 401 [] []

Not entirely sure why taxonomy terms are different than media/nodes in this situation, TBH. But that's what's happening.

@seth-shaw-unlv
Copy link
Contributor

Not sure how you even got that far @dannylamb. Mine doesn't even get past this line to verify entity type. Changing the line to if ($entity->getEntityTypeId() === $current_entity) { allows both taxonomy terms and nodes to pass through.

@seth-shaw-unlv
Copy link
Contributor

Nope, actually that edit only works for taxonomy terms. Nodes start failing there (which I didn't realize because I hadn't cleared my cache for the node I checked 🤦‍♂️).

I feel like we've hit something like this before.... where was that? Breadcrumbs, maybe? Grumble, grumble, flipping through random stacks of papers, grumble, grumble...

@dannylamb
Copy link
Contributor

Did a quick dive and am now thinking that log entry is a red herring. Turns out, its because the taxonomy term display is actually a view. The route parameters are handled slightly differently, and we just need to account for that.

For a node/media, the route match returns parameters nested in an array and keyed by their name. For the view, the entity that matches the contextual filter is returned. No nesting. There's no indication of multiple parameters whatsoever.

Easy enough to workaround. Just need to assume you've got the entity if the reset fails here: https://github.com/Islandora-CLAW/islandora/blob/8.x-1.x/islandora.module#L384

@seth-shaw-unlv
Copy link
Contributor

PR incoming..

@dannylamb
Copy link
Contributor

by the time i've figured it out @seth-shaw-unlv already has a PR lol

@whikloj
Copy link
Member

whikloj commented Oct 2, 2019

Resolved with 0d18931

Is this good to close @rosiel?

@rosiel
Copy link
Member Author

rosiel commented Oct 5, 2019

yup yup yup! i can attest that it works! (of course, it only works on vocabularies that you configure to have the gemini URI in the Islandora config. Just a reminder, because... i was confused for a second. 😅)

@rosiel rosiel closed this as completed Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants