#57574 closed enhancement (fixed)
Add a Download row action to the Media List Table
Reported by: | pbiron | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-screenshots needs-user-docs |
Focuses: | ui, administration | Cc: |
Description
As a follow-up to #41474, I think it would be useful to add a Download
row action to the Media List Table.
Patch and screenshot coming shortly.
Attachments (2)
Change History (43)
#3
@
21 months ago
yes. the only reason the Copy
row action said that was that all the other places where there is a Copy URL
button (e.g., in the Media Modal) said that.
I think it's fine without `to clipboard' :-)
#4
follow-up:
↓ 10
@
21 months ago
Could the same string as in [55156] be used? So the row action link says: Download file
.
Then the row actions will be:
Edit
| Delete permanantly
| View
| Copy URL
| Download file
This ticket was mentioned in PR #3934 on WordPress/wordpress-develop by @kebbet.
21 months ago
#5
Use Download file
as text for row action link.
#7
@
21 months ago
Hello there,
that's a nice addition to the media library IMO, I have tested the patch and it works fine, I'm able to download the file, and the copy URL update doesn't affect the feature as well, so LGTM, great job :)
#8
@
21 months ago
- Keywords commit added
- Milestone changed from Awaiting Review to 6.2
- Owner set to audrasjb
- Status changed from new to accepted
This looks perfect to me.
I think we can definitely ship it in 6.2.
#9
@
21 months ago
- Keywords needs-user-docs added
This will probably require an user docs update:
https://wordpress.org/documentation/article/media-library-screen/#actions
#12
@
21 months ago
- Keywords needs-copy-review added
The updated help tab texts might need a copy review. Something about the file is being downloaded to the user’s device or computer.
#13
@
21 months ago
- Keywords commit removed
Ah good point, indeed we need to update the help tabs.
Removing commit
pending copy review.
#14
@
21 months ago
- Keywords needs-refresh added
Great idea! I've looked at the PR that updates the strings and they look good to me - but will leave the copy review to those from the Help/About component.
There are some test failures that are related to an issue with an earlier commit to trunk
which has now been fixed. The PR needs a refresh on trunk
.
#15
@
20 months ago
- Keywords needs-refresh removed
I've updated the PR against trunk (tests are passing), and adjusted the copy a bit. Any feedback is welcome!
#16
@
20 months ago
Test Report
This report validates that the indicated patch added the enhancement.
Patch tested:
https://core.trac.wordpress.org/attachment/ticket/57574/57574.diff
Environment
OS: Windows 10 version 22H2
Web Server: Nginx
PHP: 7.4.30
WordPress: 6.2-alpha-54642-src
Browser: Chrome 109.0.5414.87
Theme: Twenty Twenty-Three
Active Plugins: No plugins activated.
Before Patch
Screenshot: https://d.pr/i/dvaXYR
After Patch
Text Changes: 'Copy URL to Clipboard' to 'Copy URL'
A download option is added and the file can download.
Screencast: https://d.pr/v/WmihOz
✅ patch is working as per enhancement request.
#17
@
20 months ago
Thanks for testing @amin7, could you please test the latest patch found at GitHub linked in this ticket? It also updated the help tab.
#18
@
20 months ago
Hi @kebbet
I checked and the help tab is also updated, here is a screenshot. https://d.pr/i/2JrdeO
Just sharing a thought of mine if I don't bother you, should the text 'Copy URL to clipboard' also be changed to 'Copy URL' in the edit mode? Here is a screencast: https://d.pr/v/ivPJjN
Thanks & regards
#19
@
20 months ago
First:
Thanks for testing @amin7!
This ticket focus on the action row links, if the button on the edit page that says Copy URL to clipboard
should be changed, that's a discussion for another ticket I guess. But the question started me thinking, should the row action for Copy URL to clipboard
be left untouched in this ticket, is there really that much visual clutter? Isn't the text there for a reason?
@audrasjb or @pbiron, do you have any opnions on this?
Secondly:
Any feedback on the help tab text is welcome, what should we go for to get this into 6.2?
https://github.com/WordPress/wordpress-develop/pull/3934#pullrequestreview-1274240130
#20
@
20 months ago
Hey hey,
This patch can replace "Copy URL to clipboard" with "Copy URL" in the row action links as it's better in the context of this ticket, but in my mind it's better to open a follow-up ticket to address other occurrences, once this once is committed.
Concerning copy review, I'd go with @costdev's proposal:
<strong>Download file</strong> downloads the original media file to your device.
#21
@
20 months ago
- Keywords needs-copy-review removed
Thanks for swift reply! PR is updated with @costdev's proposal.
#23
@
20 months ago
Everything looks great to me.
@audrasjb Can this get committed before Beta 1 (next tues)?
@audrasjb commented on PR #3934:
20 months ago
#26
Committed in https://core.trac.wordpress.org/changeset/55198
#27
follow-up:
↓ 28
@
20 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
I think wp_get_attachment_url()
should probably get escaped, like it is for the copy action.
#28
in reply to:
↑ 27
@
20 months ago
Replying to joedolson:
I think
wp_get_attachment_url()
should probably get escaped, like it is for the copy action.
I'm not sure. The copy action seems to be the only one that escapes the URL in the generated link.
@audrasjb what do you think?
#29
@
20 months ago
Yeah, as I've looked through, it seems pretty random; should probably find the commit that added the copy link and if there was any discussion there. One way or the other, we should be consistent.
#30
@
20 months ago
The ticket that added the copy
action is #54426. The escaping was first done in https://core.trac.wordpress.org/attachment/ticket/54426/54426.3.patch.
#31
@
20 months ago
- Keywords has-patch commit removed
Indeed, it is recommended to escape use esc_url
here, as @costdev pointed out in another ticket, see the function description:
eliminates invalid characters and removes dangerous characters
So, even though esc_url() is mainly used for security, this also helps when extenders return a value that has invalid characters. I guess this is one reason why the pattern exists elsewhere in Core.
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
19 months ago
This ticket was mentioned in Slack in #core-test by pbiron. View the logs.
19 months ago
#37
@
19 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
While testing 6.2-beta5 I noticed that the Download link is not present if you filter on Unattached items.
It does appear for unattached items in the other modes.
#38
@
19 months ago
- Resolution set to fixed
- Status changed from reopened to closed
Thanx for finding that @bobbingwide.
The 6.2 release leads have decided that it's too late in the cycle, and the fix will have to wait until 6.2.1.
I've opened #57890 so this doesn't get lost.
Note: shortens "Copy URL to clipboard" to reduce clutter. This seems like a reasonable change; I'm not sure that "to clipboard" is really very necessary. What else would 'Copy URL' do?