Is there any D8 port in the pipeline? If not then we let's put up the plan so that others can help.

Summary of discussions as of May 2019

Comments

jibran created an issue. See original summary.

jibran’s picture

Assigned: Unassigned » jibran

Working on this.

penyaskito’s picture

I needed a way of detecting orphan references, and thought that this would be the right place for something like that. Started https://github.com/penyaskito/field_reference_delete, sorry for the duplication and lack of collaboration but was in a rush. Do you think is it worth it?

David_Rothstein’s picture

I'm not really involved in maintaining this module anymore (at least not regularly) so if anyone from this thread wants commit access to work on the Drupal 8 version, just let me know. Thanks!

thtas’s picture

We needed something like this for a current Drupal 8 project so I had a crack at putting something together.

It's not a straight port because it uses entity delete() calls instead of using straight DB queries and it also only applies to entity reference fields or fields which inherit from the base entity reference field type class.

It also includes some field configuration to allow us to turn off the delete behaviour for particular reference fields. The default behaviour is still to do the delete though.

https://github.com/thtas/field_reference_delete

David_Rothstein’s picture

It's not a straight port because it uses entity delete() calls instead of using straight DB queries

Hm.... what entities are you deleting exactly?

This purpose of this module isn't to delete entities at all... it's to react to entities which are being deleted and to clean up database records that refer to them. (And it deliberately doesn't use the API for those updates, since that can have many unwanted side effects, e.g. bad performance, triggering other hooks that do things in response to an entity update that would not be desirable for a "housekeeping" operation such as this one, etc).

So it sounds to me like the module you wrote is something else entirely... possibly more closely related to https://www.drupal.org/project/field_referenced_delete rather than this module (except it actually sounds different than that one too)?

thtas’s picture

Ah yes sorry i guess i misunderstood how this module operates. My requirement was to tidy up entire groups of referenced entities when they are no longer referenced by something, not just their dangling field data. So it's kind of a reverse version of the field_referenced_delete module i guess? These names are so confusing!

David_Rothstein’s picture

Ha, I agree the two names are confusing. If you decide to move your module over to drupal.org, good luck coming up with a third name :)

jibran’s picture

Assigned: jibran » Unassigned
scottsawyer’s picture

Related issues: +#2537100: Port to Drupal 8

@thtas, I think you want field_referenced_delete (unfortunate name similarity). It is also in desperate need of a D8 port. You might want to post Github link over there and see if it can help jumpstart the conversation. https://www.drupal.org/project/field_referenced_delete/issues/2537100

dalin’s picture

Issue summary: View changes
dalin’s picture

Issue summary: View changes