Closed (fixed)
Project:
References
Version:
7.x-2.x-dev
Component:
Code: node_reference
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
22 Dec 2010 at 17:27 UTC
Updated:
8 Sep 2017 at 10:11 UTC
Jump to comment: Most recent file
Comments
Comment #1
gorillaz.f commentedSeems i made a mistake before.
After enable entity_token, there're field tokens in auto node title setting.
But not node/user reference token.
Comment #2
fagoWe'll need to add support for the entity API's hook_entity_property_info() in the user/node reference fields.
Comment #3
fgmThis does not look like a core hook, but an extension provided by the contrib EntityAPI. Given the intentionally limited focus of this module as an interim solution to have something like D6 nodereference/userreference until something more complete and radically architected emerges, I'm inclined to only include support for core and views, not any additional contrib: new features should go into a more definitive solution.
Also, more specifically, References does not define any new entity, so it is a bit unclear why it should implement hooks on behalf of the user and node entities, which are already defined by core. Any detail ?
Comment #4
fagoYep, it's an entity API module hook - sry for not being clear on that. I've rolled a patch for it and attached it - it's quite simple.
hook_entity_property_info() is supposed to be implemented by modules providing concrete entity properties or new field types in order to map the field types to a property type. With that mapping in place property info for each field instance is generated, such as rules or the search api can make use of it.
Comment #5
fagoAny update on this?
Would be awesome to get these two lines of code into the module, as they are required for being able to use the reference fieds with Rules.
Comment #6
das-peter commented+1 for this. I patched it in my code to be able use references in rules and it works like a charm.
Thanks fago!
Comment #7
yched commentedLooks like a no-brainer. Committed.
Thanks !
Comment #8
yched commentedIt seems exposing this info causes major memory issues when Entity API is enabled: #1058912: Prevent recursive tokens.
I'm not reverting this yet, until we get other reports of the issue.
@fago : can you take a look ?
Comment #9
fonant commentedFor some reason the 7.x-1.x-dev version [ user_reference.module,v 1.1.2.8 2011/02/15 ] of user_reference.module has
'property_type' => 'node'when it should have
'property_type' => 'user'Setting the value to "user" makes the Rules module's data selector work properly :)
Comment #11
johnvI'm reopening this issue, since I still encounter #1058912: Prevent recursive tokens, even with version 7.x-2.x-dev from 31march2011.
Reverting the 2 lines is the remedy. I only encounter the problem on 2 pages:
- admin/modules (don't know why it should appear there, are tokens used on this page?)
- admin/structure/types/manage/my_contenttype, when Automatic Nodetitles is enabled. With a small modification (see http://drupal.org/node/1068990#comment-4310800) in token.module, the auto-nodetitle fieldset shows what happens: with 70 tokens, every nodereference opens again 70 tokens, etc, exploding the memory usage.
As pointed out by Fonant, patch #4 is applied incorrectly. Correcting to 'property_type' => 'user' still leaves the memory exhaust. After removing the node_reference line, system works OK, but that's because I have no user-Fields.
Comment #12
yched commentedCommitted a fix for the user_ref property type. Silly me.
Comment #13
johnvyched, this patch causes #1058912: Prevent recursive tokens, which is critical for all Token-users.
wouldn't it be better to revert the patch, until the problem is fixed?
Comment #14
Shadlington commentedSubbing
Comment #15
aanjaneyam commentedWith due respect to all I was of the view that the memory problem patch/fix be provided in the issue #1058912: Prevent recursive tokens. This would make it easier for users to search issue queue if they encounter the memory problem. Also it would be more relevant for the purpose for which issue #1058912: Prevent recursive tokens exists.
Comment #16
cyberwolf commentedSubscribing.
Comment #17
hnln commentedsub
Comment #18
pfrenssensubscribe
Comment #19
aanjaneyam commentedThe correct thread to subscribe is #1058912: Prevent recursive tokens. The solution to memory exhaustion problem lies in a patch to token.