Skip to content

Commit

Permalink
Allowing Image fields for multi-file media (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannylamb authored Jul 24, 2022
1 parent 573d687 commit a297796
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ protected function generateData(EntityInterface $entity) {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);

$map = $this->entityFieldManager->getFieldMapByFieldType('file');
$file_fields = $map['media'];
$file_options = array_combine(array_keys($file_fields), array_keys($file_fields));
$file_options = array_merge(['' => ''], $file_options);

$map = $this->entityFieldManager->getFieldMapByFieldType('image');
$image_fields = $map['media'];
$image_options = array_combine(array_keys($image_fields), array_keys($image_fields));

$file_options = array_merge(['' => ''], $file_options, $image_options);
$form['event']['#disabled'] = 'disabled';

$form['destination_field_name'] = [
Expand Down

0 comments on commit a297796

Please sign in to comment.