Opened 9 years ago
Closed 9 years ago
#32059 closed defect (bug) (fixed)
Media views EmbedLink should check for empty url string
Reported by: | afercia | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | Media | Keywords: | has-patch |
Focuses: | ui, javascript | Cc: |
Description (last modified by )
Splitting this out from #29476. Noticed one small thing: embedding a URL in the "Insert from URL" field should handle also the case when users empty the field. To reproduce;
Edit/create a post then go in Add Media > Insert from URL
- paste an embeddable URL
- then empty the field
- at this point
url
is an empty string - the AJAX call fires
- the "Link Text" field appears
You will also see a PHP notice in your console:
<b>Notice</b>: Undefined variable: url in <b>.../ajax-actions.php</b> on line <b>2749
looks like this check in this line in /wp-includes/js/media/views/embed/link.js
if ( url && url.length < 6 ) { ...
should also check when url
is falsey.
Also, not sure why 6 characters :) http://
is made by 7 characters but maybe I'm missing something.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
My bad :) looks like the PHP notice was just in trunk and r32258 fixed it. Would recommend to still consider this ticket for the useless AJAX call to avoid and the "Link Text" field that shouldn't appear when emptying the URL field.