Problem/Motivation
The Add or Select Media dialog is inconsistent about use of singular and plural, which could cause editor confusion. It would be better to be consistent.
Steps to reproduce
1. Create a Drupal Core site in simplytest.me
2. Log in as admin
3. Go to /admin/modules
4. Filter on media
5. Enable Media and Media Library
6. Click Install
7. Upon completion, go to /admin/config/content/formats/manage/basic_html
8. Drag the picture icon out of the active area
9. Drag the media icon into the active area
10. Under Enabled Filters, check Embed media
11. Under Filter Settings, Embed media, check all boxes
12. Click Save configuration
13. Go to /node/add/page
14. Click the Insert media icon
Expected result:
Add file
Choose file
no file selected
One file only
Actual result:
Add file
Choose files
no files selected
One file only

Proposed resolution
Change above plurals to singular
Merge request link
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | Screenshot 2024-03-21 at 12.29.46 PM.png | 228.44 KB | sukr_s |
| #6 | 3418781-nr-bot.txt | 1.22 KB | needs-review-queue-bot |
| #4 | 7015.patch | 1.33 KB | sukr_s |
| Add or select media dialog.png | 161.9 KB | charles belov |
Issue fork drupal-3418781
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
sukr_s commentedpatch enclosed. #multiple is set based on the number of files upload allowed. this sets the ui text properly
Comment #5
dineshkumarbollu commented@sukr_s
MR fails pipeline due to phpcs, can you fix that i can review the MR, Thanks
Comment #6
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #7
sukr_s commentedPHPCBF issue fixed
Comment #8
smustgrave commentedAs a bug will need a failing test to show the issue.
Comment #9
sukr_s commented@smustgrave The fix resolves correctness of English in UI (plural vs. singular). Not sure how to add tests for this. If you can point to some documentation, that would be helpful.
Comment #10
smustgrave commentedMR has a test failure
UI changes should also have before/after screenshots in the issue summary.
Tests can be a simple assertion added to an existing test.
Comment #11
sukr_s commentedMR updated with fix and test cases have been updated as well.
Comment #12
smustgrave commentedLeft a comment.
Comment #13
sukr_s commented.
Comment #14
sukr_s commentedComment #15
sukr_s commentedThe button label has to change to "Choose file". I believe there is no way to assert this (or?). Attach screenshot from the automated run that shows that the label has been successfully changed
Comment #16
smustgrave commentedYea in that case I think the negative assertions should be fine.
Comment #17
catchOne question on the MR.
Comment #18
sukr_s commentedThe original code was always for "multiple files" and the test cases as well. The UI showed upload "files" even when a single file was being uploaded. So the fix was for ensuring that the right text is shown in the UI in case of single file upload. No other functionality or test cases are affected. e.g. line 300
tests for multiple files
Comment #21
catchAhh yeah, bad ctrl-f on my part it looks like, I can see coverage for both 'Add file' and 'Add files' now.
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!