Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
This thread is tracking Relation 8.x tasks and development.
THERE IS ABSOLUTELY NO UPGRADE PATH OR SUPPORT UNTIL ALPHA RELEASE.
Drupal 8 version of Relation was originally developed in the 8.x-1.x
-branch but that branch should now be considered abandoned.
Instead we are now focusing all development efforts on new 8.x-2.x
-branch. The major change from the 1.x branch is that we're now using dynamic_entity_reference module to provide the endpoints field for relations. With this change we managed to drop a lot of relation only code and in future we can benefit from all the code that works with der fields.
Comments
Comment #1
dpiRight now the API works as expected. You can C/R/U/D relation types and relations programmatically.
Relation types are now entities.
Comment #1.0
dpiUUIDs
Comment #2
dpiRelation 8.x branched updated with recent field overhaul and requirement for entity field property definitions.
Basic API of Relation and UI for managing relation types works correctly.
Comment #3
dpiUpdated to Drupal 8 alpha4.
There is now UI for rendering Relations view, edit, and delete pages.
Relation endpoint formatters have been fixed.
Implemented theme hooks and added a template for Relation pages.
Comment #3.0
dpiupgrade path
Comment #4
dpiUpdated to Drupal 8 alpha10, and through dev snapshot for 14 April 2014.
Major changes since last update:
Comment #5
kirkili CreditAttribution: kirkili commentedI must admit that I haven't looked at the Relation project in about a year. By looking at the commit history, it's obvious that a D8 branch of Relation is under sustained development even though some of the sand may be shifting underneath it until D8 beta or RC. By way of demonstrated commitment, it appears safe to assume that anyone who develops a solution using the Relation project in D7 will be assured of D8 continuity. Is this a correct assumption?
What it not clear to me however is the age-old confusion around this project and entity references, especially with D8's entities-everywhere evolution. How does the work with D8 entities assist, duplicate, or complicate features in the Relation modules?
After attending DrupalCon Austin this week, it became clear to me that unless you're willing to chase HEAD, with all that it implies, D8 won't be in an RC state any time soon, although a beta release may be much sooner depending on the feverish sprints going on today and perhaps this weekend.
Any additional perspective would be appreciated.
Comment #6
dpiThis thread has seemingly turned into a list of what major changes have happened, and I think followers have come to expect that. So any further discussion should go in a different issue.
Although we cannot make any guarantees as this is a volunteer project, you can assume that there will be a Drupal 8 version ready for production within weeks of 8.0 release.
Drupal 8 does not bring any conceptual changes to Relation over Drupal 7. For now, Relation 8 is a port-forward. New API's and hooks are taken advantage when possible. Drupal 8 includes an implementation of the Drupal 7 contributed References project, this does not change the relational "landscape" at all.
I cannot speak for mikran, but my intention is to follow alpha snapshots which have been happening on a monthly basis.
Comment #7
dpiPartial update committed for Drupal 8 beta2.
Comment #8
mikran CreditAttribution: mikran commentedI've added a note of the two development branches to issue summary. I'll also add this issue to Relation module page.
Comment #9
amkloseHello, this looks like a really useful module and I would like to use it for a new site I am starting in D8. Has there been any development on this since the RC has been released? Is there another module that this has been dropped in favor of?
Comment #10
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedEntityreference is in core and then there is the new https://www.drupal.org/project/dynamic_entity_reference but I still think there are use cases left for relation module to fill. However Relation requires quite a lot of work before it's usable in D8 so I wouldn't recommed it for any D8 project yet.
Comment #11
osab CreditAttribution: osab as a volunteer commentedHello! I'm find, if install Relathion module on Drupal 8.0.5, occurs server error 500 when I try delete any entity or node.
Error next:
After deleting Relathion module its ok.
sorry, if I publish this message not where it need)
Comment #12
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedComment #13
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedComment #14
mikeker CreditAttribution: mikeker as a volunteer commentedRe @osab in #11: I'm unable to reproduce that error with the latest Drupal 8.2.x and Relation 8.x-1.x using a very simple case of two related content types. If you are still seeing that error, you should open a separate issue for it in the Relation issue queue. And please include detailed steps to reproduce the bug. Thanks!
Comment #15
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedStatus update.
There has not been much happening on relation d8 development recently but now the 2014 issue #2315599: Consider Dynamic Entity Reference for storage needs is finally in RTBC state (thanks to everyone involved!). This is mentioned in issue summary as:
These blockers have been resolved and I hope that we can get a new boost for relation d8 development from this.
As we already have some users and installations for old endpoint fields I think it will be easier to handle this transition to new field storage by opening a new relation 8.x-2.x branch. This also means that 8.x-1.x branch will not receive any new commits but we make an attempt to follow somewhat meaningful version numbering as this change will break all existing installations.
Comment #16
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedComment #17
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedComment #18
maxilein CreditAttribution: maxilein commentedHi,
what is the state of the current 8.x.-2.x dev version?
Which functionality can be tested?
Which is still missing?
Thanks
R, Max
Comment #19
ajayg CreditAttribution: ajayg as a volunteer commentedHi Just wondering what is the status of this effort?
Comment #20
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedI mentioned here #2627034: [relation] Relation that I'm looking for new maintainer for d8 version if there ever will be one for relation.
But the more I get to know D8 the less I need relation to do things. There is always something better already implemented.
These tools did not exist when relation gained popularity in D7.
Comment #21
mgiffordOk so with 8.x-2.x of Dynamic Entity Reference https://www.drupal.org/project/dynamic_entity_reference and what is bundled in Drupal 8.4 already, what do we know for sure we would need Relation for?
So between the 3 options listed by @mikran - is this module redundant now?
Comment #22
steveoliver CreditAttribution: steveoliver at Circatree commentedThis module still serves a distinct purpose: to *qualify* relations (think _fieldable_ references). Entity Reference, Dynamic Entity Reference, and Group do not serve this purpose. The closest module to achieve something like fieldable references is field_collection, but only by abusing its design.
In other words: this module still seems necessary if you want to quality relations in D8.
Comment #23
mikran CreditAttribution: mikran at Mediamaisteri Oy commentedBoth entity reference and dynamic entity reference can be used to make any fieldable entity act as fieldable reference. There is no benefit of forcing all fieldable references to be of same type. Drupal 8 entity API makes it easy to create entity types and with this there really is no need to have a single entity type named relation and single field on it named endpoints.
If you wanted to you could create entity type called Relation and then dynamic entity reference field called Endpoints to it and you'd have this relation module functionality in D8, no Relation module required.
Comment #24
steveoliver CreditAttribution: steveoliver at Circatree commentedWell I stand corrected. :)
Comment #25
frobThe only thing that I can think of is the ability to limit the referenced entity to constraints automatically. Not saying that Relation has to work the same way it did, but I always used this module to keep metadata about a fixed group of other entities. These are enforced with the "Advanced Settings" as outlined on the docs page https://www.drupal.org/node/1276284
Comment #26
geek-merlin#23
> If you wanted to you could create entity type called Relation and then dynamic entity reference field called Endpoints to it and you'd have this relation module functionality in D8, no Relation module required.
Which just means the relation module may be quite simple for D8. And would still make sense, if we build reusable widgets for that thing.
Comment #27
frobAll I need is some entity validation logic, to limit arty, and maybe a field widget.
Comment #28
geraldito CreditAttribution: geraldito as a volunteer commentedSo how would you implement bidirectional node references in D8? Relation offers that kind of functionality.
Comment #29
amklose@geraldito would something like this work? https://www.drupal.org/project/cer
Comment #30
geek-merlinNote that relations are fieldable. Fields not.
Comment #31
demonde CreditAttribution: demonde commented@axel.rutz What is missing is something like a dummy field like in Relation for Dr7.
See https://www.drupal.org/project/reverse_entity_reference/issues/2898132#c...
Comment #32
geek-merlin#31: https://www.drupal.org/node/1276338? Pseudo fields can be implemented in D8 much the same way as in D7.
Comment #33
turpentyne CreditAttribution: turpentyne commentedI'm wondering/double-checking if this project is be a good solution for my issue...
I have several taxonomy vocabularies used to build compound fields/paragraphs. Example: my 'plant part' vocabulary is used together with either 'colors' or a 'descriptors' vocabulary to make a paragraph. My intention was to streamline things so I didn't need to repeat taxonomy words, and be able to search my Solr index for a plant entity with red leaves and green flowers.
Unfortunately, without learning how to use query hooks or a custom module above my skill level, I'm stuck - my searches can't see that specificity. I just get all plants with leaves... whether red or green. and all plants with flowers, whether green or red... and all plants with "anything" that is red or green.
That's an over-simplified explanation, but I'm hoping this project will have the ability to enable searching based on that relationship.
Comment #34
naught101 CreditAttribution: naught101 commented#33 turpentyne: I don't think relation will particularly help or hinder you there. That sounds more like a search issue.
Also, please open new support requests when asking for support. This thread is specifically for discussion of porting relation from drupal 7 to drupal 8.
Comment #35
botrisI believe there are use cases for this module: mainly fieldable relations and specify / limit the type of relation.
As per #26, as the building block already exist, the module creation "should be quite simple if we build reusable widgets for that thing."
Now my questions are; is the current 8.x-2.x-branch in a state that development could start based on the above, or is it assuming a different development path? If it's the correct branch to start, what are (roughly) the first steps?
Comment #36
pasqualleNo, the relation module should provide this functionality out of the box.
Creating a new entity is easy, but providing all the related UI and supporting the specific use case is not so easy.
Comment #37
jrwilson CreditAttribution: jrwilson commentedI've looked for the documentation for Relation in D8, didn't find any (perhaps the documentation is renamed in a core module like entityreference). I've looked at dynamic_entity_reference that produces errors when a DER field is saved. CER seems to have no development since the alpha2 on 5 May 2017. Group is way more complicated for my use case. Is there a tutorial on how to achieve bidirectional, directional and reverse direction with different labels without double editing at each node, term or user?
Comment #38
chucksimply CreditAttribution: chucksimply commentedI second #37. A lot of talk about the functionality being possible in d8 without this module, would love for someone to put together a quick tutorial laying out a build approach. Just as a foundation, showing what's available.
Comment #39
frob@ChuckSimply, a bunch of people have said it is possible, but it isn't. That is why no tutorial or example exists. When I get a project that will allow me to port this insanely useful project to D8 I will. But that is what it will take. Someone needs to port this to D8 if we are going to end up with this functionality in D8+
Comment #40
chucksimply CreditAttribution: chucksimply commentedThanks @frob. It's pretty odd there isn't a sufficient module or approach for D8 leveraging any type of basic bidirectional "friend" or "user relationship" functionality. Friend Flag is probably the closest, and it's severely limited. If anyone comes up with a workable solution in the meantime, please let us (70+ followers) know :).
Comment #41
frobYou could use ECK to create a custom entity that has two entity reference fields and use that to build relation entities. You couldn't define arity that way but some custom validation logic could do that for you.You would also be lacking any sort of UI.
Comment #42
daniel-san CreditAttribution: daniel-san commentedIt's exciting to consider using core D8 functionality to do the same thing that Relation has provided. My one big concern, and I'm hoping for feedback, is the transitive property that Relation provided. I have two projects in which we connect users with relationships and one of the main things we need is to have the transitive function so that, for example, a grandparent is connected to a parent and the parent to a child. Therefore, the grandparent is connected to the child. If Relation is not ported, does anyone know if Dynamic Entity Reference can provide this unique functionality that Relation gave us?
Thank you so much to all of the contributors to this project. It has been of great use to our projects and I'm very grateful for all of the hard work people have put into this.
Comment #43
frob@daniel-san, I know it has been 2 years but for future reference https://www.drupal.org/project/entity_hierarchy does what you want in that regard.
It is pretty disappointing to find that this (relation) module never got ported.
Comment #44
daniel-san CreditAttribution: daniel-san commented@frob thanks you so much for that information. It will be very useful as we are still working to upgrade the project and have this kind of functionality available. Thanks!!