- 🇩🇪Germany broon Potsdam
In fact, could this also be used on field types that extend the default entity reference field? In various projects, we are creating custom entity reference fields, that add new functionality, like
class LabelledEntityReference extends EntityReferenceItem
offers an Entity Reference Field, but the editor can choose a custom label to refer to the referenced node. As this field type's machine name is of course not "entity_reference", this module does not offer an option.
So, instead of checking the machine names, isn't possible to get a fields base class and then decide whether or not to offer the purge option?
- Status changed to Needs work
almost 2 years ago 4:15pm 27 February 2023 - 🇩🇪Germany broon Potsdam
Btw. the patch is incomplete as it only patches the field config form. This will add the purge option to dynamic reference fields. However, this option is only read for "entity_reference" fields in the
entity_reference_purger_entity_delete
function. - Status changed to Needs review
almost 2 years ago 5:42pm 27 February 2023 - 🇩🇪Germany broon Potsdam
Here is a patch that not only works with dynamic_entity_reference fields but all fields that extend the default entity_reference field. Thus, I am also changing the issue summary (sorry for hijacking, taggartj, but your case is included).
- 🇳🇿New Zealand code_brown
@broon thanks for the patch, this works for our use case. I had to update the patch slightly so that it would apply against the latest version. It just removes the final patch stanza which appears to already be included in the target:
https://git.drupalcode.org/project/entity_reference_purger/-/blob/1.0.x/...