Open olafgrabienski opened 7 years ago
Just saw that my request is well described on the Corresponding Entity Reference project page, mentioning also the important aspect of keeping the references in sync when one of the entities changes:
CER keeps reference fields in sync. If you have two entities that refer to each other using Entity Reference (or some other kind of reference field), it saves you the trouble of double-editing your entities in order to have them point at each other. If entity Alice references entity Bob, CER will make Bob reference Alice, and keep the references up-to-date when either entity is updated or deleted.
Edit: This is a feature request. Don't have the permissions to tag the issue.
We don't have the same tags in contrib as we have in core (but we should https://github.com/backdrop-ops/contrib/issues/136 https://github.com/backdrop-ops/backdropcms.org/issues/181 😉 )
I think this should be left to contrib. CER can cause problems because of the way it works. Problems with performance when there are lots of references.
CER can cause problems because of the way it works. Problems with performance when there are lots of references.
That sounds a bit vague to me. Which number of references will be problematic?
Using corresponding references might however not be a 80% case, that's why I suggested to provide it not as default but as an option in upcoming core. (Disclaimer: I like to have useful smaller non-necessarily-80%-use-case things in core if they are well integrated and don't trouble others. Certainly I'd also be fine with a contrib module ... which I'm not able to port unfortunately :-/)
I like the idea of having a "CER-like" ability to sync referenced items. I agree with @herbdool that CER is overly complex with how it works, but I think that core should at least house the necessary pieces to do this to a simple degree, then let contrib extend it further to make it more robust if necessary.
While I don't need two references to sync in every situation, just having the ability out of the box would be a welcomed feature.
In many cases, the following feature is useful to me:
When Node A references Node B, and both nodes have a adequate Reference field, Node B should automatically reference Node A.
This shouldn't be the default behaviour but an option, maybe somewhere in the field settings.
In Drupal, there is the module called Corresponding Entity References for it -- that's why I call the feature "corresponding references" in the issue title. Another term for the feature might be "circular references".
Speaking of "circular references", just in case we should check potential issues mentioned in https://github.com/backdrop-contrib/reference/issues/5#issuecomment-257999769 by @quicksketch .
Edit: This is a feature request. Don't have the permissions to tag the issue.