Opened 6 months ago
Closed 6 months ago
#22740 closed defect (bug) (fixed)
3.5 Media: "From URL" doesn't provide any feedback on error
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | 3.5 |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by Viper007Bond)
If you paste an image URL into the "From URL" field and your browser fails to load the image, say due to network issues or the image being 404, then you are given no indication as to why the extra fields that would normally show up aren't showing up. This can confuse users.
A simple error message stating the image was not an image or that the image failed to load (misspelling for example) would assist the user in debugging and resolving the issue.
Attachments (2)
Change History (19)
comment:1
Viper007Bond — 6 months ago
- Description modified (diff)
koopersmith — 6 months ago
comment:4
koopersmith — 6 months ago
- Keywords has-patch commit added; needs-patch removed
comment:5
follow-up:
↓ 6
johnbillion — 6 months ago
3.4 shows a red X next to the URL input field if it doesn't get a 200 when it tries to fetch the image.
comment:6
in reply to:
↑ 5
;
follow-up:
↓ 7
Viper007Bond — 6 months ago
Replying to johnbillion:
3.4 shows a red X next to the URL input field if it doesn't get a 200 when it tries to fetch the image.
Bonus: no new strings.
Replying to Viper007Bond:
Replying to johnbillion:
3.4 shows a red X next to the URL input field if it doesn't get a 200 when it tries to fetch the image.
Bonus: no new strings.
Right, but we're using that same check to determine if it is an Image. We have no good way of determining if it is not an image (but is, and is failing), or if it is not an image (and really isn't an image).
Can you please test 22740.diff? What it does is automatically assume that .jpg, .png, and .gif are images, so the fields may be shown, even if it can't load it.
If we wanted to top this off, we can probably also add back a red X if it thinks it is an image based on the extension (which will show the fields) but fetching it doesn't work (which will tell the user something is wrong).
comment:8
Viper007Bond — 6 months ago
This patch should certainly help with most cases. There's still a few edge cases but those are extra edgy because it also has to additionally fail to load.
Looks good to me.
- Milestone changed from Awaiting Review to 3.5
I think 22740.diff is likely sufficient for 3.5.
comment:10
ryan — 6 months ago
- Owner set to ryan
- Resolution set to fixed
- Status changed from new to closed
In 23048:
comment:11
follow-up:
↓ 13
ryan — 6 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
A couple of times I've seen the insert button remain inactive even though the image and the details show.
comment:12
ryan — 6 months ago
- Keywords has-patch commit removed
comment:13
in reply to:
↑ 11
koopersmith — 6 months ago
Replying to ryan:
A couple of times I've seen the insert button remain inactive even though the image and the details show.
Did you happen to record the URL in those cases?
comment:14
ryan — 6 months ago
http://trunk/wp-content/uploads/2012/12/avast12.jpg
Most of the time it works. Sometimes not. Haven't been able conjure reliable steps to reproduce.
comment:15
ryan — 6 months ago
https links not working but could be my sandbox SSL setup.
Insert a link. Modal closes. Click Add Media to pop the modal back up. From URL still shows the image that was just inserted. Maybe this should lose its memory after a successful insertion.
comment:16
nacin — 6 months ago
- Owner changed from ryan to koopersmith
- Status changed from reopened to assigned
Two issues:
- The button disabling check should simply be prop('disabled', 'http://' === text). It is designed to prevent insertion when the placeholder is there.
- The view should lose its memory.
Koopersmith working on both.
koopersmith — 6 months ago
comment:17
ryan — 6 months ago
- Resolution set to fixed
- Status changed from assigned to closed
In 23065:

Good point.
I am trying to think of the easiest way to fix this. If it's not a 200, we can show "File not found." Otherwise, it isn't an image, we can maybe reveal the discovered mime type (or do nothing).
The way we detect images is with new Image in JS. I am assuming that won't allow us to do an HTTP status code check.
We can resort to the older, less intelligent UI, which asked "Image" versus "Audio, Video, or Other File" to avoid this kind of ambiguity from being clever but not clever enough.