// Reset the field to its default settings so that we don't inherit the
// settings from the parent class' source field.
$settings = $this->fieldTypeManager->getDefaultFieldSettings($field->getType());
// Use the `large` image style and do not link the image to anything.
// This will prevent the out-of-the-box configuration from outputting very
// large raw images. If the `large` image style has been deleted, do not
// set an image style.
$field_name = $this->getSourceFieldDefinition($type)->getName(); $component = $display->getComponent($field_name); $component['settings']['image_link'] = ''; $component['settings']['image_style'] = ''; if($this->entityTypeManager->getStorage('image_style')->load('large')){ $component['settings']['image_style'] = 'large'; }
$t_args = ['%name' => $media_type->label()]; if($status === SAVED_UPDATED){ $this->messenger()->addStatus($this->t('The media type %name has been updated.', $t_args)); } elseif($status === SAVED_NEW){ $this->messenger()->addStatus($this->t('The media type %name has been added.', $t_args)); $this->logger('media')->notice('Added media type %name.', $t_args); }