Editor: Embedding youtube links on vanilla 2.2.1 #4114

Closed
CrazyLemon opened this Issue Jun 17, 2016 · 11 comments

Comments

Projects
None yet
3 participants

CrazyLemon commented Jun 17, 2016

So lets say you just paste a link (i tested with timestamp and without) into your advanced editor.
You hit Post and there it is. Your embedded youtube link shows you a thumbnail of a video but you see a typo right tehre.
You edit your post and save the changes and its all broken now. In html view you see
<a rel="nofollow" target="_blank"><img width="640" alt="" height="385"></a> and no youtube link anywhere.
Basically very similar to #3382
Advanced editor: Version 1.7.2

@linc linc added the Backport label Jun 17, 2016

@linc linc added this to the Sprint 15 milestone Jun 17, 2016

Contributor

initvector commented Jun 22, 2016

I am unable to recreate this issue in a fresh 2.2.1 install. Steps taken to reproduce:

  1. Make sure Advanced Editor is enabled and the format is set to WYSIWYG.
  2. Create a new post. I tried with a discussion and a comment.
  3. Insert a YouTube link into the post. I used https://youtu.be/YE7VzlLtp-4
  4. Save the post.
  5. Edit the post I just created, adding some text.
  6. Save the post.

The YouTube embed shows up when I first create the post, as well as when I edit it.

Do you have any other plug-ins or applications enabled that may be causing this issue?

Here's a 'live' example https://www.ubuntu.si/forum/discussion/6500/just-testing
Plugin's enabled: Add Registration Question, Advanced Editor, All VIewed, CommentRSS, Piwik Analytics, Quotes, Role Titles, Split/Merge.

Contributor

initvector commented Jun 23, 2016

I'm still unable to create the issue. Would it be possible for you to provide the contents of GDN_Discussion.Body for this discussion from your database (DiscussionID = 6500)?

The YouTube embed is generated during rendering. It isn't saved as part of the post record. Since I can't recreate the issue, it might be easier for me to determine what's going on if I can see what's happening to your post's raw Body field.

Here you go

 <a rel="nofollow" target="_blank" title="Link: null"><img width="640" alt="" height="385" title="Image: null"></a> just some youtube testing.

<br><blockquote class=" Quote">&lt;a rel="nofollow" target="_blank"&gt;&lt;img width="640" alt="" height="385"&gt;&lt;/a&gt; just some youtube testing.</blockquote><p><br></p>
Contributor

initvector commented Jun 23, 2016

Thanks! That is very strange. I have a few more questions...

  1. Are you only pasting the link to the YouTube video into your post (e.g. https://www.youtube.com/watch?v=YE7VzlLtp-4) or are you using additional embed code?
  2. When you first edit the post, does the actual video appear in the editor or is it only the link text? Or maybe nothing of the video at all?
  3. Do you see the same kind of markup in the Body field for comment 43804?

CrazyLemon commented Jun 23, 2016

  1. So i checked 43804.
    No html there at all..just text + link.

without editing&nbsp;https://youtu.be/YE7VzlLtp-4
2. By clicking 'Edit' there is no video anymore. Just blank canvas 640x385.

  1. Just pasting the link (youtube.com and youtu.be) as you can see with 43804.

And format for all those comments/discussions is Wysiwyg

Also..there's a bug with githubs editor - you can't start from 3 and go backwards but thats not vanilla issue 😄

CrazyLemon commented Jun 23, 2016

So i don't know if this helps in anyway but between the click of the 'Edit' button and showing the blank canvas there was something there for like a few hundreds of miliseconds.
So i took a video of it and here's a screenshot of that text
vlcsnap-2016-06-23-17h34m15s602

Contributor

initvector commented Jun 23, 2016

It definitely looks like your site is generating content that shouldn't be generated until the post is ready to be rendered. I am able to recreate the issue on your forum, although I still cannot create it elsewhere. I can see what is being delivered by /post/editcomment has the YouTube embed code in it, when it shouldn't.

Would you be willing to provide your site config file with all potentially sensitive information removed (database credentials, email addresses, API keys, etc.)?

I'm able to recreate it on my local testing server where i developed that site.
Here's the site config https://paste.sh/a4iEN65M#Y5Zs5VDOURKH73ajeIuXf6hu
I deleted a few entries. Probably not related to the issue (email, twitter and stuff)

Contributor

initvector commented Jun 23, 2016

That's what I needed! Thanks!

With your config, I was able to recreate the issue and have a fix pending review.

Awesome..i'm just glad it wasn't my fault 👍
Thanks for the fix.

@initvector initvector closed this Jun 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment