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

Expected behavior when taxonomy fields are deleted #1049

Open
DonRichards opened this issue Aug 7, 2024 · 3 comments
Open

Expected behavior when taxonomy fields are deleted #1049

DonRichards opened this issue Aug 7, 2024 · 3 comments

Comments

@DonRichards
Copy link
Member

Overview of feature request

This feature request aims to address a bug related to the deletion of taxonomy fields and their impact on the Solr index. When a taxonomy field indexed by Solr is deleted, it can cause white-screen errors due to inconsistencies between the Solr index and the data.

What kind of user is the feature intended for?

Developer

What inspired the request?

The need to prevent white-screen errors and improve the stability of the Islandora system when a taxonomy field that is indexed by Solr is deleted.

What existing behavior do you want changed?

Currently, deleting a taxonomy field that is indexed by Solr leads to an inconsistent Solr index, which can result in white-screen errors and make troubleshooting difficult.

Any brand new behavior do you want to add to Islandora?

Implement a function that removes Solr facets and fields associated with a deleted taxonomy field to maintain index consistency and prevent errors.

Any related open or closed issues to this feature request?

None specified.

@rosiel
Copy link
Member

rosiel commented Aug 9, 2024

Something that i'm aware of that might be coming into play here, is that when you delete a taxonomy term, it does not delete references to it. All nodes that linked to that term, still have that term stored in their field. It is very hard to see this because whenever a term is rendered, it is loaded, and if it can't be loaded then it just ignores it. But you can see the reference if you go to [site]/node/[nid]?_format=json (note, just json not jsonld). The folks at DGI (sorry, can't recall who) suggested this module https://www.drupal.org/project/entity_reference_integrity which has a submodule that won't let you delete a term if it's referenced by nodes.

My suspicion, knowing this, is that Solr is breaking at least in part because it's trying to index and/or render taxonomy terms that have been deleted.

@adam-vessey
Copy link

@rosiel: To deal with some other types of entity references, it might also be necessary to use something like: https://github.com/discoverygarden/entity_reference_integrity_extra/

IIRC, those TypedRelation fields (and any other non-core extended "entity reference" fields) would not get picked up by the core entity_reference_integrity processes.

@kayakr
Copy link

kayakr commented Aug 20, 2024

@rosiel fyi, we've been using https://www.drupal.org/project/entity_reference_purger on a site to deal with some of these dangling term references.

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