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

White screen when accessing JSON-LD representation of node in some circumstances #2039

Closed
alxp opened this issue Feb 2, 2022 · 1 comment
Labels
Repository:Islandora Issues pertaining to the repository: https://github.com/Islandora/islandora Subject: Access Control related to managing roles and permissions/information security. Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org Subject: Linked Data related to linked data. Consider also using metadata or modelling tags. Type: bug identifies a problem in the software with clear steps to reproduce

Comments

@alxp
Copy link
Contributor

alxp commented Feb 2, 2022

PR: Islandora/islandora#862

Steps to Reproduce

In an Islandora site, clone the https://github.com/roblib/islandora_premis module into the modules/contrib folder and check out the 'unpublished' branch. and then enable the module.

Create a new Repository Item object, and uncheck 'Published' before saving.

Append '/premis' to the end of the new object's url, e.g. /node/3/premis.

Expected behaviour

The PREMIS data about the object, represented as Turtle text should be displayed.

Actual output

The message "The website encountered an error" is shown.

Findings

I'm working with a module that sets up a controller endpoint that includes a nid.

As per proper Drupal 8.x+ practise, it has had entity access check in the routing.yml file, e.g.

islandora_premis.premis:
  path: '/node/{node}/premis'
  defaults:
    _controller: '\Drupal\islandora_premis\Controller\IslandoraPremisPremisController::main'
  options:
    parameters:
      node:
        type: 'entity:node'

In islandora.module there is an alter reaction hook that runs context reactions on the JSON-LD normalized array.

Currently it will set a cache tag on the array. However, when entity access check is added, no 'cacheability' array key is set, and the module white screens.

@alxp alxp added Repository:Islandora Issues pertaining to the repository: https://github.com/Islandora/islandora Subject: Access Control related to managing roles and permissions/information security. Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org Subject: Linked Data related to linked data. Consider also using metadata or modelling tags. Type: bug identifies a problem in the software with clear steps to reproduce labels Feb 2, 2022
@jordandukart
Copy link
Member

Merged in Islandora/islandora#862.

Repository owner moved this from Todo to Done in Islandora Issues Queue Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Repository:Islandora Issues pertaining to the repository: https://github.com/Islandora/islandora Subject: Access Control related to managing roles and permissions/information security. Subject: Drupal related specifically to Drupal, usually pointing somewhere on drupal.org Subject: Linked Data related to linked data. Consider also using metadata or modelling tags. Type: bug identifies a problem in the software with clear steps to reproduce
Projects
Development

No branches or pull requests

2 participants