Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading Featured Image inserts it into post content #3393

Closed
Ipstenu opened this issue Nov 8, 2017 · 15 comments · Fixed by #5432
Closed

Uploading Featured Image inserts it into post content #3393

Ipstenu opened this issue Nov 8, 2017 · 15 comments · Fixed by #5432
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media [Status] Needs More Info Follow-up required in order to be actionable.

Comments

@Ipstenu
Copy link
Contributor

Ipstenu commented Nov 8, 2017

Issue Overview

When you upload a featured image, it puts it into the post CONTENT if you happen to have your cursor in a text block.

Steps to Reproduce (for bugs)

  1. Write a post
  2. While your cursor is in a text block, upload featured image
  3. Congratulations, you now have a featured image in your post content

Note: This DOES NOT happen if you have your cursor in the title block or (magically) in no block at all.

This MAY be related to why #3392 happens

Expected Behavior

The featured image uploader should not insert the image into post content.

Current Behavior

The featured image gets inserted and ends up in the content

@mtias mtias added [Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media labels Nov 20, 2017
@youknowriad
Copy link
Contributor

youknowriad commented Dec 28, 2017

I can't reproduce this, can you confirm it's fixed?

@youknowriad youknowriad added the [Status] Needs More Info Follow-up required in order to be actionable. label Dec 28, 2017
@Ipstenu
Copy link
Contributor Author

Ipstenu commented Dec 29, 2017

Nope, not fixed.

I just reproduced it on my site.

@youknowriad
Copy link
Contributor

It's probably related to your setup, plugins, theme etc... I can't reproduce on a fresh install. Anything particular we should test with?

@Ipstenu
Copy link
Contributor Author

Ipstenu commented Dec 30, 2017

I've opened a support ticket with StudioPress to ask them about that (and linked here)

@Ipstenu
Copy link
Contributor Author

Ipstenu commented Jan 3, 2018

@youknowriad Can I DM you or otherwise send you a link to the themes? (you can email me ipstenu AT halfelf.org if needed :) ) - Due to the theme being premium, I don't want to post it up for free :)

@danielbachhuber
Copy link
Member

@Ipstenu Were you able to track down any additional details? If so, can you share them on this ticket?

@Ipstenu
Copy link
Contributor Author

Ipstenu commented Jan 24, 2018

No, but it’s still happening as of last week. This week I was writing a lot of posts with code, and since #4456 is an issue, I have to go back to the old editor for that.

@JeroenSormani
Copy link

JeroenSormani commented Mar 3, 2018

I can confirm this is still happening for me in version 2.3.0.

For me its not always required to have the pointer specifically in the post to get this snag (but it does give the result most consistently).
Strangely some images seem to be more consistent with showing double then others - and even some images don't ever seem to have get this.
Its a bit weird, but when trying to make a gif for here I wanted to do so with a Stripe logo image, but it never appeared double.

Thinking it may be the file type, but it happens to both png and jpg.

I can also confirm its actually uploading the image twice for me.

@JeroenSormani
Copy link

JeroenSormani commented Mar 3, 2018

So I'm really hard trying to find a consistency of when this happens. Done probably over 300+ uploads of images to try and find when this is happening exactly. Every time I think I've found a consistency it stops there and its no longer happening.

Here's what I know so far:

  • It happens sometimes
  • Doesn't happen with all images (Stripe logo won't)
  • When it happens, the image is also double uploaded to the media library
  • It is not required to have the pointer on the content, I've done many tests with specifically clicking outside the containers and even in the menu / address bar before clicking 'Set featured image'.
  • The location where the image appears in the post is not consistent with where the cursor is/was before.
    • It does appear that the image gets uploaded UP TO being the 5th block, never below there, even if there's plenty more below.
  • In relation to the above, when testing with only a few block (less then 5) is appears less frequently, which could mean it may still try, but can't inset it in the, say 4th block as they don't exist..?

Here's a GIF, you can see the first time it doesn't happen, the second it does.
screen recording 2018-03-03 at 10 05 am

Image I get good consistency with:
stocksnap_mrf1628s9a-500px

Stripe logo that doesn't get this behaviour:
stripe 2 1

@JeroenSormani
Copy link

Sorry, after I just posted that I did a couple more tests with the stripe logo as I don't think I've tried that in a post where I had many blocks before, it does have the same consistency as the other image when testing it in post with the many blocks as per the GIF.

Weirdly enough this one seems to only insert at the 5th+ block (up to the 7th). Which is very weird as the other one definitely doesn't go beyond the 5th for me.
It only inserting in the 5~7th block could explain why I initially thought it didn't get the behaviour earlier..

Hope I'm being helpful in a way, there seems to be some consistency, just a really weird one.
I'm on the WP slack if anyone needs additional info or maybe a screenshare?

@youknowriad
Copy link
Contributor

You are definitely being helpful and I think I know the real issue thanks to you.

I believe from the gif that you're dragging the image to the modal to upload it right? I never tried that before instead I was using buttons. I think what happens is that the "drop" behavior of the modal is triggered but also the "drop" behavior of the editor behind the modal.

Thanks for the help.

@JeroenSormani
Copy link

Makes perfect sense.., I must've been very consistent in dragging those two different images to different heights then! (which also kinda makes sense as they were at entirely different locations in my finder) 🙄

@gziolo
Copy link
Member

gziolo commented Mar 9, 2018

It should be fixed with #5432. Can you confirm?

@JeroenSormani
Copy link

Didn't seem to work initially, but after running npm run build it no longer double adds the image.
Can confirm it works for me 👍

@Ipstenu
Copy link
Contributor Author

Ipstenu commented May 1, 2018

Just to confirm, it's working for me too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Media Anything that impacts the experience of managing media [Status] Needs More Info Follow-up required in order to be actionable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants