Verified Commit a87a72fa authored by Dave Long's avatar Dave Long
Browse files

Issue #3275557 by andypost, catch, heddn: Add webp image conversion to core's...

Issue #3275557 by andypost, catch, heddn: Add webp image conversion to core's install profile's image style
parent 68c1000f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1418,6 +1418,7 @@ webheads
webhosting
webmention
webmozart
webp
webroot
webservers
webtest
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public static function defaultStorageSettings() {
   */
  public static function defaultFieldSettings() {
    $settings = [
      'file_extensions' => 'png gif jpg jpeg',
      'file_extensions' => 'png gif jpg jpeg webp',
      'alt_field' => 1,
      'alt_field_required' => 1,
      'title_field' => 0,
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ public function testDefaultImages() {
    $non_image = $this->drupalGetTestFiles('text');
    $this->submitForm(['files[settings_default_image_uuid]' => \Drupal::service('file_system')->realpath($non_image[0]->uri)], 'Upload');
    $this->assertSession()->statusMessageContains('The specified file text-0.txt could not be uploaded.', 'error');
    $this->assertSession()->statusMessageContains('Only files with the following extensions are allowed: png gif jpg jpeg.', 'error');
    $this->assertSession()->statusMessageContains('Only files with the following extensions are allowed: png gif jpg jpeg webp.', 'error');

    // Confirm the default image is shown on the node form.
    $file = File::load($default_images['field_storage_new']->id());
+3 −3
Original line number Diff line number Diff line
@@ -38,14 +38,14 @@ public function testWidgetElement() {
    $this->assertSession()->pageTextNotContains('Image test on [site:name]');

    // Check for allowed image file extensions - default.
    $this->assertSession()->pageTextContains('Allowed types: png gif jpg jpeg.');
    $this->assertSession()->pageTextContains('Allowed types: png gif jpg jpeg webp.');

    // Try adding to the field config an unsupported extension, should not
    // appear in the allowed types.
    $field_config = FieldConfig::loadByName('node', 'article', $field_name);
    $field_config->setSetting('file_extensions', 'png gif jpg jpeg tiff')->save();
    $field_config->setSetting('file_extensions', 'png gif jpg jpeg webp tiff')->save();
    $this->drupalGet('node/add/article');
    $this->assertSession()->pageTextContains('Allowed types: png gif jpg jpeg.');
    $this->assertSession()->pageTextContains('Allowed types: png gif jpg jpeg webp.');

    // Add a supported extension and remove some supported ones, we should see
    // the intersect of those entered in field config with those supported.
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ protected function setUp(): void {
      'entity_type' => 'node',
      'bundle' => 'page',
      'required' => TRUE,
      'settings' => ['file_extensions' => 'png gif jpg jpeg'],
      'settings' => ['file_extensions' => 'png gif jpg jpeg webp'],
    ])->save();

    EntityFormDisplay::create([
Loading