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

dpi’s picture

Right now the API works as expected. You can C/R/U/D relation types and relations programmatically.
Relation types are now entities.

dpi’s picture

Issue summary: View changes

UUIDs

dpi’s picture

Relation 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.

dpi’s picture

Updated 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.

dpi’s picture

Issue summary: View changes

upgrade path

dpi’s picture

Issue summary: View changes

Updated to Drupal 8 alpha10, and through dev snapshot for 14 April 2014.

Major changes since last update:

  • Merged Relation UI submodule into parent module.
  • Split Relation generator from Relation UI into new Relation Devel module.
kirkili’s picture

I 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.

dpi’s picture

This 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.

dpi’s picture

Partial update committed for Drupal 8 beta2.

mikran’s picture

Issue summary: View changes

I've added a note of the two development branches to issue summary. I'll also add this issue to Relation module page.

amklose’s picture

Hello, 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?

mikran’s picture

Entityreference 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.

osab’s picture

Hello! 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:

Call to a member function getColumns() on boolean in SITENAME/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php on line 173

After deleting Relathion module its ok.
sorry, if I publish this message not where it need)

mikran’s picture

Issue summary: View changes
mikran’s picture

Category: Task » Plan
mikeker’s picture

Re @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!

mikran’s picture

Status 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:

The other branch 8.x-1.x-der is alternate approach to endpoint storage needs (#2315599: Consider Dynamic Entity Reference for storage needs). However this branch is EXPERIMENTAL only as it requires a core patch from #2384459: Add entity query condition for delta in EFQ.

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.

mikran’s picture

Issue summary: View changes
mikran’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
maxilein’s picture

Hi,

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

ajayg’s picture

Hi Just wondering what is the status of this effort?

mikran’s picture

I 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.

  1. For simple use cases, entityreference is now in core and its way better than relation for those
  2. If your use case is a little bit more complex than that then there is dynamic entity reference in contrib
  3. And finally if you're doing something crazy then I recommend looking at the group module

These tools did not exist when relation gained popularity in D7.

mgifford’s picture

Ok 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?

steveoliver’s picture

This 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.

mikran’s picture

Both 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.

steveoliver’s picture

Well I stand corrected. :)

frob’s picture

The 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

geek-merlin’s picture

#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.

frob’s picture

All I need is some entity validation logic, to limit arty, and maybe a field widget.

geraldito’s picture

So how would you implement bidirectional node references in D8? Relation offers that kind of functionality.

amklose’s picture

@geraldito would something like this work? https://www.drupal.org/project/cer

geek-merlin’s picture

Note that relations are fieldable. Fields not.

demonde’s picture

@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...

geek-merlin’s picture

#31: https://www.drupal.org/node/1276338? Pseudo fields can be implemented in D8 much the same way as in D7.

turpentyne’s picture

I'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.

naught101’s picture

#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.

botris’s picture

I 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?

pasqualle’s picture

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.

No, 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.

jrwilson’s picture

I'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?

chucksimply’s picture

I 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.

frob’s picture

@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+

chucksimply’s picture

Thanks @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 :).

frob’s picture

You 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.

daniel-san’s picture

It'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.

frob’s picture

@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.

daniel-san’s picture

@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!!