Hello,
I am using Token with Simplenews in order to add node-referenced fields to my Simplenews content.
Anyway, here is the problem (see attachment for more accurate piece of information) :
I browse my replacement patterns, click on Nodes then on the Content type I'm trying to load contents' fields from.
It does list my items (Node with delta 1, Node with delta 2, Node with delta 3 etc.) and it says that "The list item with delta 1. Delta values start from 0 and are incremented by one per list item.".
So in this case the machine name of the Token should be "[node:field-simplenews-news:0]" instead of actual "[node:field-simplenews-news:1]".
The same machine name is applied to the content's fields.
In conclusion, the machines names aren't correct because in my case I do only have [node:field-simplenews-news:0] and [node:field-simplenews-news:1].
Hope this sounds clear enough ! :)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1821902-4-show-delta-0-for-referenced-entities.patch | 565 bytes | emattias |
| screenshot 2012-10-24 at 4.18.25 PM.png | 30.1 KB | Antonin Brunon |
Comments
Comment #1
andregriffin commentedThank you. I kept using the wrong replacement token. Changing the delta to 0 helped.
Comment #2
dave reidI cannot support the tokens provided by the Entity tokens module. They are not related to this module.
Comment #3
dubcanada commentedSo this is an issue with entity tokens? I also noticed this problem with tokens and pathauto it says Delta:1 and Delta:2 but no Delta:0
Comment #4
emattias commentedThis is due to PHP's way of comparing in non-strict mode.
The short version is that when using non-strict (==) comparison 0 is always evaluated to true when compared to any string. Longer exlanation here: http://stackoverflow.com/a/8672423
Delta 0 shows up by making the in_array comparison strict. This patch does that.
Comment #5
dave reidOh thanks for being persistent with this. Confirmed the issue and committed to 7.x-1.x.
Comment #7
dave reidCommitted to 8.x-1.x as well.