-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add check for cache tags in JSON-LD alter hook. #862
Conversation
Use valid license string per composer validate.
Looks like no problem requiring filehash:'^1.1 || ^2' |
Was a bit concerned about changes to Lines 178 to 203 in 2923a1a
That being said it doesn't look like the https://api.drupal.org/api/drupal/8.0.x/search/hook_file_update So I don't think this code is ever called? Perhaps the dependency along with this function could be removed completely? |
Oh there is also a view included https://github.com/Islandora/islandora/blob/2.x/modules/islandora_core_feature/config/install/views.view.file_checksum.yml |
@nigelgbanks, it won't show up in a search because it is covered by hook_entity_update. This allows us to trigger new derivatives when the file gets replaced. |
@seth-shaw-unlv ah that makes sense. Could a possible issue arise if the user chooses any other algorithm than |
@nigelgbanks, the Drupal web UI doesn't let you replace a file, but there are various other ways to do it (e.g. the Migrate API import update flag, custom code, and the endpoints our Crayfish microservices hit). As for pinning MD5, 🤷♂️ I haven't tested it. |
Think if there's additional discussion required about Islandora's usage of |
JSON-LD really should be updated in the future to follow the new suggested way of handling cacheability. Unrelated to this PR in general. |
Co-authored-by: Jordan Dukart <jordan@discoverygarden.ca>
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.
Looks fine to me after discussion/testing. Tests are failing due to PHP8.1 deprecations now only.
GitHub Issue: (link) Islandora/documentation#2039
What does this Pull Request do?
Fixes a white screen when getting a JSON-LD representation of a node when the controller includes an entity access check.
What's new?
Adds an 'isset' to fix a null array access in the jsonld normalizer alter function.
Does this change add any new dependencies?
no
Does this change require any other modifications to be made to the repository
no
Could this change impact execution of existing code?
No
How should this be tested?
Problem occurs when dealing with unpublished content.
If you have a controller that correctly checks for entity access, e.g., in routing.yml:
The entity access check makes it such that the output is not cacheable as it would be without it. Thus there is no 'cache ability' array element.
All entities accessible to the logged-in user should now be visible as JSON-LD, e.g.
/node/{nid}?_premis=jsonld
Documentation Status
Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora/8-x-committers