First of all great work on the module, it's making things much easier already.

I've hit a problem migrating one specific content type in my setup. I've got multiple sites running Drupal 7 and they need to be kept in sync, so far so good, but one of the content types has programmatically created fields, i.e. I can't see them when I go to structure > content types > xyz > manage fields. They are created in the module code itself, the fields in question are created like this:

for ($i = 0; $i < $num_options; $i++) {
      $option = (count($options) > 0) ? array_shift($options) : NULL; // grab each option in the array
      $form['resultoptions'][$i] = array(
        '#type' => 'fieldset',
        '#title' => t('Result Option ') . ($i + 1),
        '#collapsible' => TRUE,
        '#collapsed' => FALSE,
      $form['resultoptions'][$i]['option_name'] = array(
        '#type' => 'textfield',
        '#title' => t('The name of the result'),
        '#default_value' => isset($option['option_name']) ? $option['option_name'] : '',
        '#maxlength' => 255,
        '#size' => 40,

I can't seem to find a way to sync these fields, as they don't show in the list of unmapped fields that I have to setup.

Can you point me in the right direction?



wonder95’s picture

My thought would be to define a custom source field in the constructor to hold this, map it to the target field, and then run this code for each node in prepareRow() and fill the source field. It will more than likely slow things down, but it will allow you to generate the values you need on the fly.

roberttstephens’s picture

+1 for wonder95's suggestion.

mikeryan’s picture

Status:Active» Postponed (maintainer needs more info)

One thing to note is that the list of available fields for mapping is really just a UI convenience - you can use field names that aren't in the list in field mappings just fine. In this case, on the destination side, just map to the non-field field. The source side is a little trickier - where are these programmed fields being stored in the database? You'll need to add something somewhere to query them and add them to $row so you can migrate from them.

mikeryan’s picture

Status:Postponed (maintainer needs more info)» Closed (cannot reproduce)