Closed (duplicate)
Project:
Date
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Jun 2012 at 22:13 UTC
Updated:
8 Mar 2014 at 09:35 UTC
Jump to comment: Most recent
I have a date-field which has a "to date" and allows multiple values. I get the following token values:
[node:field-multiple-dates] = "Property 0"
[node:field-multiple-dates:value] => Fatal error: Call to a member function value() on a non-object in \sites\all\modules\entity\entity_token.tokens.inc on line 297
I have verified this on a clean drupal install with latest version of drupal, and latest dev versions of date and entity.
Steps to reproduce:
field_multiple_dates[node:field-multiple-dates] tokenThis is a new issue as per #1530042-16: Get Entity Tokens working; see that issue for more comments / error reports.
Comments
Comment #1
bforchhammer commentedI traced back the fatal error back to line 183 in
entity_token.tokens.inc:$replacement = _entity_token_get_token($wrapper->$property_name, $options);When I use tokens for the format "[node:field-date:value]", then
$wrapperis an instance of EntityListWrapper, and$property_nameis "value" (or whatever is used after the colon in the token); this results in NULL being passed to_entity_token_get_token(), which then causes the fatal error...I'd be happy to roll a patch, but I have absolutely no idea how to fix this... Any advice?
Comment #2
bforchhammer commentedPossibly related: #1520420: Entity tokens for multi-value fields still not working (or need documention).
Comment #3
bforchhammer commentedPart of the problem seems to lie with using
list<struct>as the type for date field properties; this probably needs to be solved in the entity module, see #1621084: Support list<struct> type tokens.Comment #4
karens commentedI don't think any part of this issue is anything that can be controlled by the Date module. There are a couple links to Entity API issues, which is what this probably is.
Comment #5
13rac1 commentedThis is currently a dupe of #1440928: Entity tokens for multi-value fields produce a fatal error. Although, with the linked patch applied, there are no errors, but nothing appears for the value, value2 tokens.
Comment #6
lmeurs commentedI second #5: applied the patch from #1440928: Entity tokens for multi-value fields produce a fatal error, the error disappears, but unfortunately tokens do not work.