Hi,

I'm not 100% sure why, but while some token values seem fine, any node reference values seem unavailable. I have attached import data for my two content types and for my rule. You can import them all and test for yourself. The rule sends an email to the author of the referenced Question content when a related Answer node is created. Here's the email text that comes through:

Hello admin,

You have received an answer to the question you posted on the TES New  
Teachers website:
[referenced_question:field_answer_question-title]

To read the answers follow this link:
[referenced_question:field_answer_question-link]

If you no longer want to receive these alerts, follow these instructions to  
turn them off:

Click on the link above

Sign in to the website and then click on the Edit tab

Uncheck the Notify me of answers and click the Save button.

PS: You can turn your messages back on at any time.



Best wishes

TES New Teachers team

As you can see, the other tokens are fine - but the ones bringing in node reference data are all broken. Similarly, if I try to check the value in a referenced field in Actions I also get no data.

Will just code this in hook_nodeapi() for now... shame, would've been great as a Rule.

CommentFileSizeAuthor
answer.txt6.23 KBgreg.harvey
question.txt6.38 KBgreg.harvey
rule.txt5.81 KBgreg.harvey

Comments

fago’s picture

Title: Node reference token values not available » CCK token of loaded variables don't work

Strange, the exports looks fine.

Marked #763404: Content profile node CCK field tokens not replaced as duplicate.

klausi’s picture

Patches welcome, as fago and I are currently busy with Rules 2.x developments.

doughold’s picture

I am having the same problem, any thoughts as to why this would be happening? Or where I can start looking for issues maybe?

doughold’s picture

My issue was that I just wasn't loading the referenced node as an action first. Didn't realize you had to do that.

greg.harvey’s picture

Oh? Maybe that's my problem too. I don't know now, because I wrote some code instead, but I could re-import my stuff to a blank Drupal install and try it out.

jeffschuler’s picture

I was having this issue too.
Loading the referenced node first (as in comment #4) and using those provided tokens partially resolved this for me.

I am still, however, (and this may deserve another issue,) seeing the un-replaced token text for CCK location elements, like [referenced_contact:field_loc_home-name] (where referenced_contact is my pre-loaded noderef node,) -- when that location field does not contain any content.

If the node does have a location, I see that data properly -- and blank fields in the location show up blank (appropriately) if they're there. If there's no location, all of the un-replaced tokens show up for all location fields.

mitchell’s picture

Status: Active » Closed (won't fix)

Old issue. Please reopen if necessary.

mitchell’s picture

Component: Rules Engine » Rules Core

Updated component.