Closed (fixed)
Project:
Relation add
Version:
7.x-1.0-beta1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
25 Mar 2012 at 00:05 UTC
Updated:
5 Jul 2012 at 12:26 UTC
Jump to comment: Most recent file
Comments
Comment #1
mr.york commentedFirst patch.
Comment #2
mr.york commentedAdd endpoint label settings for relation field widget.
Clear related entity cache when saving a relation.
Comment #3
Chris Gillis commentedWhy has this not been done anywhere yet? It seems like such a core piece of functionality to the relation module. I was about to code my own field for a system I'm building and then I found this... but I'm hesitant to use the "relation add" module which is centered around a "block". Is this a departure from the purpose of the module? Does anyone have advice for me of other discussions / attempts that have been made around this desired functionality?
Comment #4
Chris Gillis commentedActually, it seems like this functionality exists in: http://drupal.org/project/relation_select. Care to comment on differences?
Comment #5
mr.york commentedNext version.
Fixed relation field save.
Fixed display label name.
Comment #6
mr.york commentedCommited patch.
Comment #7
nagy.balint commentedThe main advantages of relation add module:
- uses a different widget which is less problematic and more node reference like
- it lets you fully use the fieldable relations, cause you can fill the additional fields when you create the connection, relation select does not have this functionality.
Comment #8
kork commentedGreat module! Thanks a lot!
The dropdown for the releation type isn't set when editing a node. On line 527 it should be
'#default_value' => isset($type) ? $type : NULL,it would be nice to store the resulting relation ids with the field, so one can use the delta to change the weight. do you accept patches?
Comment #9
mr.york commentedThank you!
Fixed.
Comment #11
kork commentedI've got some fixes for special cases here: I have directional relations on the same node type and restrict the field only to those relations. This patch fixes the relation_type_load call for reversed releations and replaces the reverse relation detection by looking at the endpoint data.
Comment #12
mr.york commentedUse coding standards, please.
I fixed the relation type select issue with the field widget.
Comment #13
scottrigbyThis patch is looking great!
The only issue I ran into is when two content types share the same directional relation field, one with a reverse endpoint - when a relation is deleted from one field instance, it still appears in the other, until a cache clear.
Quick proof of concept (not a patch, but I can add one if this seems reasonable):
In function relation_add_field_update():
It would probalby be better to target the individual field cache directly - something like what relation_add_entity_presave() does, but checking each bundle the field may be part of…
Comment #14
scottrigbyOk patch and interdiff attached.
Comment #15
mr.york commentedPlease do not reopen this issue, if you find any problems open a new issue for it. Thanks.
Comment #16
scottrigby@mr.york #15 is a confusing response given your patch in #12.
In any case, should I open #13/14 as a separate issue?
Comment #17
mr.york commentedNo, I've commited all patches.