Needs review
Project:
Content Construction Kit (CCK)
Version:
6.x-2.x-dev
Component:
nodereference.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
23 Sep 2008 at 16:20 UTC
Updated:
11 Nov 2010 at 22:04 UTC
Jump to comment: Most recent file
Comments
Comment #1
gregglesThis is probably a token/cck bug, not a Pathauto bug.
If you could provide more details (the pattern you used, the expected URL, the actual URL) that would be helpful.
Comment #2
yched commentedI'd bet this is because the noderef field is set to be hidden in 'full node' view.
We just added a way to separate the display settings for tokens
Get latest CCK 6.x-2.x-dev (er, maybe wait another day for the package to be rerolled with today's commits.
Be sure to run update.php
Visit the 'Display fields' tab for the content type - set the display settings for 'Token' (1st choices for all fields should be what you want)
Please reopen if the problem persists.
Comment #3
justafishThe noderef field isn't hidden in full node view, I haven't even touched the display settings of any fields I've made in fact.
The pattern I have in my pathauto settings is:
[term-raw]/awards/[field_award_reference-title]
The output I'm getting is
<term>/awards
<term>/awards-0
etc
if I change it to
[term-raw]/awards/[field_award_reference-nid]
then it works, I get <term>/awards/<nid of referenced node>
I haven't tried your suggestion yched as the field isn't hidden as you suggested, so let me know if you still want me to try it.
Comment #4
justafishjust had exactly the same problem using Automatic Nodetitles. The nid works but the title doesn't. I guess this is a token problem then.
Comment #5
gregglesThe token implementations for cck are in the cck module.
Comment #6
justafishIt appears that the $object that's passed to the function nodereference_token_values (content.token.inc, line 70)
only contains 'nid' and 'error_element' (and sometimes '_weight'). I would assume that the node referenced isn't being loaded, with the nid value coming from the value of the reference field, but maybe someone more enlightened has more to say on that?
Comment #7
justafishComment #8
greggles@justafish - thanks for this patch and good detective work finding the cause. I think it would be better from a performance standpoint to use a custom query that just loads the necessary elements rather than a full node_load which can be quite slow.
Maybe that's not entirely possible due to the $node->view element...
Comment #9
liquidcms commentednot sure anyone cares at this point.. but this is also broken in D5
Comment #10
gregglesSeriously?
Of course people care. There are many competing priorities for attention and this issue is one of them.
Further, there is a patch on this issue! Did you try it? Could you review it?
Comment #11
liquidcms commentedwell at first glance i wuold have to say the patch won't worl to well for Dr5 since cck doesn't have a content_token.inc file; but this morning i seem to be thinking a little clearer; there is a token_cck.inc in the token module - i'll try the changes there and commit a patch on that module if they work.
Comment #12
liquidcms commentedor perhaps you meant this: http://drupal.org/node/222214 and that there was a patch already. lot of changes in that patch; i guess i should be using that - all i did was apply the changes from the patch here to the token_cck.inc file and they seem to work; but perhaps it doesn't work as well as i think??
Comment #13
aquila commentedI am seeing quite similar behaviour with referenced nodes, but it seems more complicated. Referenced nodes work, but nodes referenced by referenced nodes do not, although they are shown in the possible tokens box. Should I submit a new bug or add it to this one?
Comment #14
ezra-g commentedThe patch in #7 no longer applies. Attached is a re-roll. I added a title-raw token missing in the earlier patch and I kept the node_load, though greggles makes a good point that we should avoid that if it's possible.
Comment #15
sirkitree commentedThanks, applies and works for me.
Comment #16
marcp commentedThe patch above worked great for me -- fixed my auto node titles that had HTML entities in them from nodereference titles.
There's mention above, and in the patch, of $node->view. That looks like it'd be something valid, but I can't seem to figure out what that's supposed to be (views compatibility?).