Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm using CF to tabulate data in created content. The user specifies hours for each section, CF successfully multiplies by pay for each section, and then a grand total CF field adds all the sections' CF total pay field:
$node_field[0]['value'] =
$node->field_computetotal[0]['value'] +
$node->field_edfcompute1[0]['value'] +
$node->field_edfcompute2[0]['value'] +
$node->field_edfcompute3[0]['value'] +
$node->field_edfcompute4[0]['value'] +
$node->field_edfcompute5[0]['value'] +
$node->field_edfcompute6[0]['value'] +
$node->field_edfcompute7[0]['value'];
However, this doesn't seem to work after the initial creation of the document. After editing the document and resaving it, the grand total field finally works.
Is there a workaround or something?
Comments
Comment #1
Moonshine CreditAttribution: Moonshine commentedNot sure I completely understand this but it sounds like you have a computed field that gathers a grand total from other computed fields? My guess is that your grand total computed field is being triggered for calculation before your other fields are calculated. You might want to try reordering that one to the end of the list.
Comment #2
mmjvb CreditAttribution: mmjvb as a volunteer commented