I have a profile2 with computed field that - under a typical user registration - processes another value from the registration form.
HOWEVER, I need to migrate a bunch of existing users and need to set the computed field's value from a CSV.
PROBLEM: the computed field's code still gets triggered (presumably through a node_save call or whatever magic migrate uses), which in this particular case produces a null value.
WONDERING: can I temporarily replace the computed field's code with something that recognizes the already-set value that migrate is passing? What would that code look like?

Comments

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

In your migration class, define a complete() method - this runs after the node_save(), so you can fix up anything the node_save() got wrong:

  public function complete($node, $row) {
    // Do what you need to do to $node->field_my_computed_value....
  }
mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

No further response.