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

[BUG] Deleting a term does not delete Typed Relation references to it. #86

Closed
rosiel opened this issue Sep 19, 2022 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@rosiel
Copy link
Member

rosiel commented Sep 19, 2022

What steps does it take to reproduce the issue?

  • Create a term.

  • Create a typed relation field on a node [any entity? not sure]

  • Refer to the created term in the typed relation field.

  • Delete the term.

  • When does this issue occur?
    When you delete the term the problem happens; it becomes visible on reloading the node's page

  • Which page does it occur on?
    Any node. I have not tested on other entities.

  • What happens?
    The value remains in the node. When viewing the node, the "Type" label appears (in this case "Attributed name:"), but where the term name formerly rendered, nothing is rendered.

Screenshot showing the typed relation with a type but no term content.

Devel's node JSON showing intact reference to missing term

  • To whom does it occur (anonymous visitor, editor, administrator)?
    It is confusing to everyone, I'm sure.

  • What did you expect to happen?
    I thought the delete hook was picked up by typed relation fields.

Which version of Islandora are you using?
the version on the sandbox. The real question is what version of controlled access terms? Which is not apparent from the interface.

Any related open or closed issues to this bug report?

Not that I know of

Screenshots:
inline

EDIT: this is not a Typed Relation issue. This is how Drupal Entity Relationship fields work too.

@rosiel rosiel added the bug Something isn't working label Sep 19, 2022
@rosiel
Copy link
Member Author

rosiel commented Oct 13, 2022

DGI just released https://github.com/discoverygarden/entity_reference_integrity_extra which may affect this issue. Their module makes Entity Reference Integrity work with Typed Relations fields.

Entity Reference Integrity lets you query what references a given entity. It is not clear if Entity Reference Integrity allows you to do what I was attempting: Delete a term and all relationships to it. It does however have a submodule which would allow you to "protect" the integrity, thereby preventing you from deleting an entity (through the GUI only perhaps?) that is referenced to by other entities.

@DonRichards DonRichards added enhancement New feature or request bug Something isn't working and removed bug Something isn't working enhancement New feature or request labels Oct 26, 2022
@rosiel
Copy link
Member Author

rosiel commented Oct 26, 2022

This is just how Drupal works.

When you delete an entity, any references to it are NOT automatically deleted. They do not usually appear on the front-end, because they are displayed as 'labels' or 'rendered entities' and Drupal renders nothing. However with Typed Relation fields the "type" stuff still gets displayed, so the weirdness is visible and obvious.

This revelation affects metadata in a huge way. Keeping these references around in the JSONLD is wrong.

In general, being able to "cleanly delete" any drupal entity in a way that excises all references to it would be very desirable!

I think the broader issue needs to be fixed, and that we should not try to paper over this in the UI to hide the fact that a Typed Relation points to a deleted entity.

@rosiel rosiel closed this as completed Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants