Hi,
according to Fago, the Computed Field module should provide a token. In my setup, it simply does not.
Computed Code:
if (!empty($node_field[0]['value'])) { // the node is not new
return $node_field[0]['value'];
}
else { // the node is new
$count = db_result(db_query("SELECT COUNT(*) from node WHERE type = 'mediathek'"));
$node_field[0]['value'] = $count;
}
Token is supposed to be available for automatic title generation through Automatic node titles.
Thanks & greetings, -asb
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | explainfield_token_support.patch | 777 bytes | shawn dearmond |
Comments
Comment #1
shawn dearmond commentedHere's a patch that works for me. See if it works for you.I have only tried it using workflow_ng.Oops, wrong place. Sorry, this was supposed to go to the explainfield module issue.
Shawn
Comment #2
shawn dearmond commentedThis is a duplicate issue, anyway, and a patch is available:
#243775: Token support for computed field
Comment #3
asb commentedThanks for the pointer. The patch applies cleanly, but it only solves the problem halfway: When saving once, the computed field's value isn't entered; after erasing the node's title and saving the node a second time, it is entered properly. For whatever reason, Pathauto doesn't have this problem, there the token is evaluated correctly.
Greetings, -asb