I've created a directional, unique relation between organizations named "is creator of", with reverese label "is created by", just as it si described here: https://drupal.org/node/1276284
My relation structure is: Org A -> Org B and Org B -> Org C. But on Org B's connections page it says "is creator of" for both connections. One should be "was created by". It's very interesting, because a similar issue was marked fixed a year ago: #1674984: Reverse label of relation not showing

In redhen_relation.module, at line 195, the relation_get_type_label() function is called without a second argument, what is for reverse label. Here's a patch to fix this, please review it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fricike’s picture

Status: Active » Needs review
FileSize
1 KB

The patch.

levelos’s picture

Status: Needs review » Fixed

Thanks fricike, committed with a slight change in 1025ec3d86caa3f0c530971f64f50c19b109ad6e.

fricike’s picture

Status: Fixed » Needs work
FileSize
58.37 KB

I hate to say this, but it's not working. :( Here's a screenshot. The relation label is "raised up", the reverse is "was raised up".

fricike’s picture

Sorry, the texts on the picture are messed up, here's a corrected one.

Liam Morland’s picture

Issue summary: View changes
Liam Morland’s picture

The method in the patch for determining whether or not the label is reversed doesn't work if both items are of the same type, such as a parent/child relationship between two entities of type person.

Liam Morland’s picture

Status: Needs work » Needs review
FileSize
694 bytes

This patch is fixing it for me. Caution: I don't understand the code in detail, so it might work just for my specific parent/child case and not in other cases.

  • Commit 1025ec3 on 7.x-1.x, tests, redhen-donation by levelos:
    #2036515 by fricike, levelos: Use reverse label when needed on relations...

  • Commit 1025ec3 on 7.x-1.x, tests, redhen-donation, relation-roles by levelos:
    #2036515 by fricike, levelos: Use reverse label when needed on relations...
gcb’s picture

Status: Needs review » Closed (fixed)
Liam Morland’s picture

Status: Closed (fixed) » Fixed

Thanks very much.

Issues should be marked Fixed; they will change to "Closed (fixed)" automatically if there are no follow-up comments.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.