Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#32006 closed defect (bug) (fixed)

Problem with setting width and height of embedded media

Reported by: pavelevap's profile pavelevap Owned by: azaozz's profile azaozz
Milestone: 4.2 Priority: high
Severity: normal Version: 4.2
Component: Media Keywords:
Focuses: Cc:


  • Create new post.
  • Insert Youtube video, not directly but from Media modal window - From URL.
  • Set maximum width and height.
  • Insert into post.


1) Width and height not set in editor.

2) When you click "Edit", there are no fields for setting width and height anymore.

3) When you switch from Visual to Text and then back again, there is no preview, but only shortcode in visual editor.

Attachments (1)

32006.patch (398 bytes) - added by iseulde 9 years ago.

Download all attachments as: .zip

Change History (14)

#1 @pavelevap
9 years ago

4) Code shows that there should be also "Link Text" field (above height and width settings), but it is currently hidden. I am not sure if it should be hidden and why?

#2 @helen
9 years ago

@pavelevap - please open one ticket per distinct issue. Point 3 sounds unrelated to width/height setting. "Link text" is irrelevant if there's an embed - it's a fallback for when there's no embed available for a URL so the user can insert a link instead. Not sure what you expect it to do when an embed is available. It was previously just discarded (the field was labeled "Title"), which is a weird experience for users.

#3 @pavelevap
9 years ago

ad 4) You are right, it is invalid. I saw this field in 4.1.1 and now it is much better for embedded links.

I added first 3 points together to one ticket because they are related (described workflow):

1) I tried to set width and height for embedded video and it did not work. These fields were not available in 4.1.1.

2) I tried to edit width and height of embedded media because it was not set correctly in editor. But now there are no fields for settings of width and height when you click "Edit" for embedded media.

3) Then I switched to Text editor to see inserted shortcode and when I switched back to Visual, there was no preview (only shortcode). This point is related to previous two points, because problem can be observed only when you tried to edit inserted embedded media before switching.

All these 3 issues are regression. In 4.1.1 there was no option to set width and height and also no problem when switching to Text and back to Visual (after trying to edit embedded media).

I was not able to identify which issues are connected, so I created only one ticket with my workflow.

#4 @helen
9 years ago

  • Milestone changed from Awaiting Review to 4.2

For investigation - @azaozz or @iseulde, any thoughts?

#5 @DrewAPicture
9 years ago

  • Owner set to azaozz
  • Status changed from new to assigned

#6 @iseulde
9 years ago

I can't even insert it in the editor:

<br />
<b>Notice</b>:  Undefined index: link_text in <b>/Users/iseulde/Sites/wp/trunk/src/wp-admin/includes/ajax-actions.php</b> on line <b>2493</b><br />

Probably caused by [32055].

9 years ago

#7 @iseulde
9 years ago

I made a mistake in [32055]. I accidentally changed embed.url to embed.linkText. This does not solve the width/height problem though, which is caused by something else.

Last edited 9 years ago by iseulde (previous) (diff)

This ticket was mentioned in Slack in #core by drew. View the logs.

9 years ago

#9 @azaozz
9 years ago

  • Priority changed from normal to high

Another possibly related bug:

  • Paste [embed][/embed] in the Text editor or insert from the media modal Insert from URL.
  • Click on the preview and edit it.
  • Either click on "Insert into post" (which should have been "Update" at this point) or cancel/close the modal.

The preview remains selected and cannot be deselected. Also in Chrome the caret cannot be placed above or below the preview, making the editor look "locked".

Editing works properly when was pasted directly in the editor. Only embeddable content inside [embed] shortcodes cannot be edited.

#10 @helen
9 years ago

In 32247:

Avoid a PHP notice when adding an embed via Insert from URL.

props iseulde.
see #32006, #29476.

This ticket was mentioned in Slack in #core by helen. View the logs.

9 years ago

#12 @helen
9 years ago

Realistically this is a dupe of #31139, but will leave it open until that's been reverted so we can re-test point 3 before hopefully closing out. If point 3 still stands,then we should repurpose this ticket.

#13 @azaozz
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 32258:

Revert editing of video embed parameters in the media modal, [31620] and [31626] for now. Plan on revisiting in 4.3.
Props iseulde. Fixes #31139, fixes #32006.

Note: See TracTickets for help on using tickets.