config->get('default_scheme'); return $config; } /** * {@inheritdoc} */ public function buildConfigurationForm(array $form, FormStateInterface $form_state) { $form = parent::buildConfigurationForm($form, $form_state); $map = $this->entityFieldManager->getFieldMapByFieldType('image'); $file_fields = $map['media']; $file_options = array_combine(array_keys($file_fields), array_keys($file_fields)); $file_options = array_merge(['' => ''], $file_options); // @todo figure out how to write to thumbnail, which is not a real field. // see https://github.com/Islandora/islandora/issues/891. unset($file_options['thumbnail']); $form['destination_field_name'] = [ '#required' => TRUE, '#type' => 'select', '#options' => $file_options, '#title' => $this->t('Destination Image field'), '#default_value' => $this->configuration['destination_field_name'], '#description' => $this->t('This Action stores the derivative in an Image field. If you are creating a TIFF or JP2, instead use "Generate a Derivative File for Media Attachment". Selected target field must be an additional field, not the media\'s main storage field. Selected target field must be present on the media.'), ]; $form['mimetype']['#value'] = 'image/jpeg'; $form['mimetype']['#description'] = 'Mimetype to convert to. Must be compatible with the destination image field.'; return $form; } }