Problem/Motivation

Able to select multiple images in media library field and not able to remove

Steps to reproduce

Go to media library form, and select a media(image) file and upload an image, now you will see, you can select multiple image files. and when you submit the form. it will through an error that multiple media files are not allowed and when we try to remove them, it doesn't work and media files doesn’t removed.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

I have added a screenrecording for reference.

Comments

Gauravmahlawat created an issue. See original summary.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

maggie_s’s picture

Any news on this bug? We are facing the same behavior

gauravvvv’s picture

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

amneh.shawish’s picture

Comment #4 / The patch is working fine.

gauravvvv’s picture

Status: Active » Needs review
StatusFileSize
new45.67 KB

I have attached the comment #4 patch here. Please review

nayana_mvr’s picture

StatusFileSize
new19.98 MB
new16.18 MB

Verified the patch #8 and tested it on Drupal version 10.1.x. The patch works fine. When multiple media is selected, there will be a message shown as warning and if we try to insert the selected images then the same message will be shown as en error. I have added the before and after screen recordings for reference.

sonam.chaturvedi’s picture

Verified and tested patch #8 on 10.1. Patch applied successfully and works fine.

Test Result:
When user tries to insert multiple media > Error message is displayed saying that only 1 media is allowed.
Screenshot is available in #9.

RTBC +1

prasanth_kp’s picture

StatusFileSize
new178.59 KB

@Gauravvv Thanks for the patch. #8 Patch applied successfully on 10.1.x-dev and works fine for me.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs issue summary update

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

This could use an issue summary update for steps to reproduce, proposed solution, screenshots, remaining tasks, etc.

Thanks.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

anybody’s picture

I agree this is still an issue and the currect 1 of 1 text doesn't help a lot if you don't know *which* media is selected and you can't deselect it.

gauravvvv’s picture

Issue summary: View changes
adwivedi008’s picture

Patch at #8 works great for 9.5.x and 10.1.x but it failing for D-10.2.x

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.