Well, this really isn't a "bug" yet, but I want a placeholder for the change I"m about to commit to the 7.x dev branch. Basically I'm moving things back to compute during entity "insert" and "update" as it traditionally did with the D6 version of Computed Field, for reasons outlined in:

#414088: Computed fields should compute on $op='presave' and/or $op='validate'

This will ensure that $entity->nid is always available to computed code which seems to be a popular piece of data. I'm not sure what (if any) ramifications there are for not running under "presave" in D7 other then those potentially outlined in the D6 issue above. If anyone hits one, please add it to this "pre-bug" report ;)

Thanks..

Comments

odisei’s picture

I'm using the Automatic Node Title module. I have a computed field which is used during automatic node title generation - decimal data type.

During node creation, I get the following error:
Notice: Undefined offset: 0 in computed_field_tokens() (line 398 of .../sites/all/modules/computed_field/computed_field.module).

After I edit the node and save it again, everything works great.
Interestingly, similar thing happens with NEW taxonomy terms, which are not already stored in the database - after I edit/save the node, the NEW term appears in the generated title.
Any ideas?

colan’s picture

Assigned: Moonshine » Unassigned

@odisei: That is a separate issue. It does not belong in this one.

colan’s picture

Status: Needs review » Fixed

The change has now been there for a while, and I haven't seen any complaints.

colan’s picture

Status: Fixed » Closed (duplicate)

I might add that tokens are even available now, even though they aren't in D6.