Hi

I've spent a very long while trying to use the extender functionality for the wordpress_migrate, that is in the migrate_ui. I've kind of got it here but there's a few things that I am finding very difficult that could be alleviated with either some documentation or changing some attributes and methods to public

currentStep should be made available to extender classes that are adding in new UI steps, otherwise it is just not feasible to use getContext().

I am trying to do this in an extender. Unless there is something I am missing?

$new_step = $this->wizard->addStep(t('Select custom types to import'), [$this, 'customSelectForm'], $wizard_steps[t('Select content to import')], $context);

public function customSelectForm(&$form_state) {

    $form_state['wizard']->currentStep->getContext();
    // Get destination node type(s)
    $node_types = node_type_get_types();
    $options = ['' => t('Do not import')];
    foreach ($node_types as $node_type => $info) {
      $options[$node_type] = $info->name;
    }

    $form['media']['media_type'] = [
      '#type' => 'select',
      '#title' => t('Import WordPress media posts as'),
      '#options' => $options,
    ];

    $form['news']['news_type'] = [
      '#type' => 'select',
      '#title' => t('Import WordPress news posts as'),
      '#options' => $options,
    ];

    return $form;
  }

Comments

michaelmallett created an issue. See original summary.

michaelmallett’s picture

Issue summary: View changes
michaelmallett’s picture

Issue summary: View changes