- Issue created by @Athul Dinesh
- Status changed to Postponed: needs info
12 months ago 2:18pm 28 December 2023 What is the fieldโs configuration? What is the theme? Is the bug reproducible on Drupalโs default themes?
- ๐ฎ๐ณIndia Athul Dinesh
Steps to reproduce
- Access the Drupal administration panel.
- Navigate to "Structure" and select "Content types."
- Choose the relevant content type and click on "Manage fields."
- Within the content type's field management, add a new image field.
- Use default settings, including the default allowed image types.
- Save the field configuration.
- Proceed to create a new node of the designated content type.
- The field configuration displays both duplicate allowed types and the default allowed types (see attached screenshot for reference).
- The default theme, which is Claro, exhibits the same issue, and it's consistent across all themes, including the default theme.
- Status changed to Active
12 months ago 9:16am 29 December 2023 Is this on a newly-installed Drupal site? If not, can you reproduce the bug using https://simplytest.me/?
- Assigned to PrabuEla
- Status changed to Postponed: needs info
12 months ago 4:15pm 29 December 2023 - ๐ฎ๐ณIndia Athul Dinesh
After installing a new Drupal 10.2.0 site and adding a new image field the issue was not initially present. However, after debugging, we identified that the problem comes from core/modules/file/file.module at line 1248. The specific line of code triggering the issue is:
$descriptions[] = t('Allowed types: @extensions.', ['@extensions' => $upload_validators['file_validate_extensions'][0]]);
When this particular line is commented out, the issue with duplicate allowed types disappears.Is there any solution available for this issue?
- Status changed to Active
12 months ago 9:13am 3 January 2024 - Issue was unassigned.
- Status changed to Postponed: needs info
11 months ago 12:04pm 10 January 2024 - ๐ฎ๐ณIndia arun.testing3
Same Issue reported in https://www.drupal.org/project/svg_image/issues/3413668 ๐ Replace upload validators with new ones introduced in Drupal 10.2 RTBC
- ๐ช๐จEcuador jwilson3
Affects both svg_image and svg_image_field.
๐ Duplicate allowed types help text Active
This is related to the deprecation and syntax changes of the file validators. See the related CR file_validate and related functions are deprecated and replaced with file.validator service and Constraint plugins โ .
Example code snippets exhibiting the error from SVG Image Field module.
/** * Plugin implementation of the 'image_image' widget. * * @FieldWidget( * id = "svg_image_field_widget", * label = @Translation("SVG image"), * field_types = { * "svg_image_field" * } * ) */ class SvgImageFieldWidget extends FileWidget { //... /** * {@inheritdoc} */ public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) { $element = parent::formElement($items, $delta, $element, $form, $form_state); $field_settings = $this->getFieldSettings(); $element['#upload_validators']['file_validate_extensions'][0] = 'svg'; } // ... }
If this syntax change is a deprecation in a minor version of Drupal core, then the old method using `file_validate_extensions` should still work (and still have working tests in core) and not introduce the duplicate allowed types text.
- Status changed to Active
8 months ago 1:54pm 24 April 2024 - ๐ฆ๐ทArgentina darktek
This is happening to me too in my current backend theme which is Claro with the Drupal version .26
- ๐ช๐จEcuador jwilson3
We're using DeprecationHelper to solve this in SVG Image Field module:
https://git.drupalcode.org/project/svg_image_field/-/merge_requests/32/d...
Thoughts on accuracy?
If this is correct, how best can the approach be added in the CR https://www.drupal.org/node/3363700 โ ? Would it require a complete reworking of the Before / After section, or perhaps better to add a follow-up section below describing its use (or maybe just a link)?
- ๐ฎ๐ณIndia prashant.c Dharamshala
Not able to replicate with the #3 ๐ Allowed type text is duplicated in the back end of image field Active steps, but could not reproduce issue on
11.x
It might be happening due to some custom code or contributed module.
Thanks!
- ๐ฎ๐ฉIndonesia drupalnesia
This bug appear again on Drupal 10.3.0 on User Profile Image.
- ๐ฎ๐ณIndia prashant.c Dharamshala
@drupalnesia
I am still not able to reproduce the issue both in
11.x
and10.3.0
as well.I have vanilla Drupal installed and tested with the existing user image field and by creating new File (image) upload fields as well in Content type and User accounts.
Could you please list down the steps you took to reproduce the issue?
- ๐ฎ๐ณIndia mahendrakalal
@prashant.c I believe this issue might be related to Issue #3413668 on the SVG Image module ๐ Replace upload validators with new ones introduced in Drupal 10.2 RTBC . Please correct me if I'm mistaken.