Loading core/modules/file/src/Element/ManagedFile.php +1 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ public static function processManagedFile(&$element, FormStateInterface $form_st } if (!empty($element['#accept'])) { $element['upload']['#attributes'] = ['accept' => $element['#accept']]; $element['upload']['#attributes']['accept'] = $element['#accept']; } // Indicate that $element['#title'] should be used as the HTML label for the Loading core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ public function testWidgetElement(): void { $min_resolution = 50; $max_resolution = 100; $field_settings = [ 'description' => 'test description', 'max_resolution' => $max_resolution . 'x' . $max_resolution, 'min_resolution' => $min_resolution . 'x' . $min_resolution, 'alt_field' => 0, Loading @@ -36,7 +37,7 @@ public function testWidgetElement(): void { // Verify that the image field widget is found on add/node page. $this->assertSession()->elementExists('xpath', '//div[contains(@class, "field--widget-image-image")]'); // Verify that the image field widget limits accepted files. $this->assertSession()->elementExists('xpath', '//input[contains(@accept, "image/*")]'); $this->assertSession()->elementExists('xpath', '//input[@aria-describedby][contains(@accept, "image/*")]'); $this->assertSession()->pageTextNotContains('Image test on [site:name]'); // Check for allowed image file extensions - default. Loading Loading
core/modules/file/src/Element/ManagedFile.php +1 −1 Original line number Diff line number Diff line Loading @@ -326,7 +326,7 @@ public static function processManagedFile(&$element, FormStateInterface $form_st } if (!empty($element['#accept'])) { $element['upload']['#attributes'] = ['accept' => $element['#accept']]; $element['upload']['#attributes']['accept'] = $element['#accept']; } // Indicate that $element['#title'] should be used as the HTML label for the Loading
core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php +2 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ public function testWidgetElement(): void { $min_resolution = 50; $max_resolution = 100; $field_settings = [ 'description' => 'test description', 'max_resolution' => $max_resolution . 'x' . $max_resolution, 'min_resolution' => $min_resolution . 'x' . $min_resolution, 'alt_field' => 0, Loading @@ -36,7 +37,7 @@ public function testWidgetElement(): void { // Verify that the image field widget is found on add/node page. $this->assertSession()->elementExists('xpath', '//div[contains(@class, "field--widget-image-image")]'); // Verify that the image field widget limits accepted files. $this->assertSession()->elementExists('xpath', '//input[contains(@accept, "image/*")]'); $this->assertSession()->elementExists('xpath', '//input[@aria-describedby][contains(@accept, "image/*")]'); $this->assertSession()->pageTextNotContains('Image test on [site:name]'); // Check for allowed image file extensions - default. Loading