Issue #3425318 by Wim Leers, smustgrave: Update `type: field.formatter.settings.file_video` to match the validation logic in FileVideoFormatter's settings form
(cherry picked from commit 6e7fa7f365)
			
			
				merge-requests/6829/merge
			
			
		
							parent
							
								
									a69343b5b5
								
							
						
					
					
						commit
						106d55288c
					
				| 
						 | 
				
			
			@ -95,6 +95,8 @@ field.field_settings.file:
 | 
			
		|||
file.formatter.media:
 | 
			
		||||
  type: mapping
 | 
			
		||||
  label: 'Media display format settings'
 | 
			
		||||
  constraints:
 | 
			
		||||
    FullyValidatable: ~
 | 
			
		||||
  mapping:
 | 
			
		||||
    controls:
 | 
			
		||||
      type: boolean
 | 
			
		||||
| 
						 | 
				
			
			@ -105,9 +107,17 @@ file.formatter.media:
 | 
			
		|||
    loop:
 | 
			
		||||
      type: boolean
 | 
			
		||||
      label: 'Loop'
 | 
			
		||||
    # @see \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::settingsForm
 | 
			
		||||
    multiple_file_display_type:
 | 
			
		||||
      type: string
 | 
			
		||||
      label: 'Display of multiple files'
 | 
			
		||||
      constraints:
 | 
			
		||||
        # @see \Drupal\file\Plugin\Field\FieldFormatter\FileMediaFormatterBase::settingsSummary()
 | 
			
		||||
        Choice:
 | 
			
		||||
          # Multiple file display: Multiple HTML tags
 | 
			
		||||
          - tags
 | 
			
		||||
          # Multiple file display: One HTML tag with multiple sources
 | 
			
		||||
          - sources
 | 
			
		||||
 | 
			
		||||
field.formatter.settings.file_audio:
 | 
			
		||||
  type: file.formatter.media
 | 
			
		||||
| 
						 | 
				
			
			@ -116,6 +126,8 @@ field.formatter.settings.file_audio:
 | 
			
		|||
field.formatter.settings.file_video:
 | 
			
		||||
  type: file.formatter.media
 | 
			
		||||
  label: 'Video file display format settings'
 | 
			
		||||
  constraints:
 | 
			
		||||
    FullyValidatable: ~
 | 
			
		||||
  mapping:
 | 
			
		||||
    muted:
 | 
			
		||||
      type: boolean
 | 
			
		||||
| 
						 | 
				
			
			@ -123,9 +135,17 @@ field.formatter.settings.file_video:
 | 
			
		|||
    width:
 | 
			
		||||
      type: integer
 | 
			
		||||
      label: 'Width'
 | 
			
		||||
      nullable: true
 | 
			
		||||
      constraints:
 | 
			
		||||
        Range:
 | 
			
		||||
          min: 1
 | 
			
		||||
    height:
 | 
			
		||||
      type: integer
 | 
			
		||||
      label: 'Height'
 | 
			
		||||
      nullable: true
 | 
			
		||||
      constraints:
 | 
			
		||||
        Range:
 | 
			
		||||
          min: 1
 | 
			
		||||
 | 
			
		||||
field.formatter.settings.file_default:
 | 
			
		||||
  type: mapping
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -54,7 +54,8 @@ class FileVideoFormatter extends FileMediaFormatterBase {
 | 
			
		|||
        '#size' => 5,
 | 
			
		||||
        '#maxlength' => 5,
 | 
			
		||||
        '#field_suffix' => $this->t('pixels'),
 | 
			
		||||
        '#min' => 0,
 | 
			
		||||
        // A width of zero pixels would make this video invisible.
 | 
			
		||||
        '#min' => 1,
 | 
			
		||||
      ],
 | 
			
		||||
      'height' => [
 | 
			
		||||
        '#type' => 'number',
 | 
			
		||||
| 
						 | 
				
			
			@ -63,7 +64,8 @@ class FileVideoFormatter extends FileMediaFormatterBase {
 | 
			
		|||
        '#size' => 5,
 | 
			
		||||
        '#maxlength' => 5,
 | 
			
		||||
        '#field_suffix' => $this->t('pixels'),
 | 
			
		||||
        '#min' => 0,
 | 
			
		||||
        // A height of zero pixels would make this video invisible.
 | 
			
		||||
        '#min' => 1,
 | 
			
		||||
      ],
 | 
			
		||||
    ];
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue