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

Gallery Block: Image src URL replace with embed URL #62461

Closed
filipanoscampos opened this issue Apr 1, 2022 · 15 comments
Closed

Gallery Block: Image src URL replace with embed URL #62461

filipanoscampos opened this issue Apr 1, 2022 · 15 comments
Labels
[Block] Gallery Core Gallery block [Closed] Resolved Issue is resolved. Use for issues that can be closed but did not have an explicit fix with a PR. Images [Pri] Normal [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. [Type] Bug User Report This issue was created following a WordPress customer report

Comments

@filipanoscampos
Copy link

Quick summary

We have two reported cases in which images previously added to a Gallery Block disappear from Simple sites.

Steps to reproduce

Many attempts to reproduce this on simple sites have been made, yet I have not been able to until now.

Yet, since this is something that affects two different websites, there is definitely something causing this that should be looked into.

Both cases were on long posts, with many galleries and images of content-rich sites.

What you expected to happen

I expected the Galleries to display the images.

What actually happened

The Galleries display This image has an empty alt attribute; its file name is playlist or This image has an empty alt attribute; its file name is 4k5fbQ1, for example.

Context

One case was from a user with a Simple Business plan site, the other from a user on a Free plan.

What is seen instead on the published post is this:
Live site

And the Editor shows this:
Editor

When we investigate further, the code shows that the src of the gallery images has been replaced with the URL that was added to an embed on the page.
In one case, the URL was on a Youtube playlist.
In another case, the URL was pointing to an Instagram post.

When we attempt to recover from a previous version, the issues persist.
When we check previous versions, this is what we see:
Screenshot_2022-03-14_at_10_19_48

Tickets:
4889705-zd-woothemes
4821363-zd-woothemes

Investigation P2 post:
p2EDhh-1wb-p2

Simple, Atomic or both?

Simple

Theme-specific issue?

No.

Browser, operating system and other notes

No response

Reproducibility

No response

Severity

Some (< 50%)

Available workarounds?

Yes, difficult to implement

Workaround details

The affected galleries can be rebuilt by accessing the revisions and retrieving the correct URLs for the missing images.
Yet, given the number of posts affected in one of the cases, this is highly time-consuming.

@filipanoscampos filipanoscampos added [Type] Bug User Report This issue was created following a WordPress customer report labels Apr 1, 2022
@formosattic
Copy link

Not sure if we'll be able to replicate this as it seems caused by a core update.

Looking at the revision screenshot above, based on the the unordered list HTML removed, it looks like this is related to Gallery block refactor that was included in WordPress 5.9, more details:

A timeline of the core merges to Simple sites:

  • 5.9.0 - 2022/01/26, p94tqY-qK-p2
  • 5.9.1 - 2022/02/23, p94tqY-rh-p2
  • 5.9.2 - 2022/03/11, p94tqY-rp-p2
  • 5.9.3 - 2022/03/30, p94tqY-rR-p2

@pauljacobson pauljacobson added [Block] Gallery Core Gallery block Images labels Apr 4, 2022
@pauljacobson
Copy link

Hi @formosattic 👋

Thank you for the feedback. Based on the second post you linked to, it seems that one possible workaround is to make a minor change to an affected post (perhaps adding a space), and clicking Update. Have I understood that correctly?

@formosattic
Copy link

formosattic commented Apr 4, 2022

@pauljacobson : I shared the second link https://www.koberoku.com/content/why-wordpress-5-9-broke-your-galleries-and-how-to-fix-it , for the reference of the unordered list that is now gone.
I'm not sure that the fix suggested there would apply for WordPress.com, especially because the bug has the other odd behavior of replacing the image URL with the link of an embed content on the same page. But I'm not familiar enough with the code to know. I guess, it's worth trying though I'm wary it may break other things.

Internal convo: p1649134545554789/1649047692.645469-slack-C7YPUHBB2

@filipanoscampos
Copy link
Author

@pauljacobson and @formosattic
Yes, in one of the cases the user made many changes to a post and the issue persisted.
So this workaround will not solve the issue at hand.

@formosattic
Copy link

Shared from internal convo with @Greatdane (p1649387812620979/1649032944.419269-slack-C01UW7SB411), here's a similar report, issue happened after changing theme: p2EDhh-1qk-p2

@inaikem
Copy link
Contributor

inaikem commented Apr 19, 2022

@glendaviesnz 👋 This appears to be an edge case and I'm not 100% sure how we should proceed. Based on the work you did on the core Gallery block refactor, is there anything you can suggest as a next step?

@glendaviesnz
Copy link
Contributor

@glendaviesnz 👋 This appears to be an edge case and I'm not 100% sure how we should proceed. Based on the work you did on the core Gallery block refactor, is there anything you can suggest as a next step?

@inaikem do you know if there are any old versions of the post that include the images - I think somewhere it mentioned there were previous versions that could be restored, but when restored the same thing happened? If you were able to get me the raw content of an old post revision with the images included I would have a better chance of trying to work out what has gone wrong.

@inaikem
Copy link
Contributor

inaikem commented Apr 20, 2022

@Automattic/dotcom-triage-pa-group, I'm EOD at the moment, is someone around to help answer Glen's question?

@filipanoscampos
Copy link
Author

@glendaviesnz

What was happening was that, when we attempted to restore to the previous version, the Galleries would still be broken.

We can write to the user and ask them if they can share a post with us we can experiment with.
Do you think that could work?

@glendaviesnz
Copy link
Contributor

What was happening was that, when we attempted to restore to the previous version, the Galleries would still be broken.

If you are restoring and opening straight away in the editor then the editor might be rewriting the block content. We would need to try and get the raw post content of the old version of the post without loading it in the editor - not sure what the easiest way to do that is.

We can write to the user and ask them if they can share a post with us we can experiment with. Do you think that could work?

If you can find a post where we have access to a previous revision that has the image links, and get their permission to have a closer a look at it I will see if I can find if we can get a copy of the raw revision post content somehow.

@daria2303
Copy link

@glendaviesnz user is asking for an update, what are we planning for this issue? :)

@glendaviesnz
Copy link
Contributor

@daria2303 as noted here, we would need access to a copy of the post with the image links included in order to try and work out why this happened. Because it is a strange edge case that we can't replicate we can't do anything else without that, unfortunately.

There is a slim possibility that it was related to this other bug WordPress/gutenberg#41161, which was fixed here WordPress/gutenberg#41221, and released in 6.0.1 and Gutenberg 13.4, so if you are able to access copies of the post prior to the problem you could try loading them in the editor again and see if the images stay in place now.

@mriyazuddin
Copy link

User had provided the list of posts in #4821363-zd. I just looked at all those posts and could see that the Galleries are appearing fine now. There are no more errors and the images appear fine. I've let the user know and asked them to check and reconfirm. Guess it was indeed related to WordPress/gutenberg#41161. If user confirms its fixed, we can close this issue.

@github-actions
Copy link

github-actions bot commented Aug 2, 2022

Support References

This comment is automatically generated. Please do not edit it.

@cometgrrl cometgrrl added [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. [Pri] Normal labels Jan 10, 2023
@cometgrrl
Copy link
Contributor

Closing since it's been > 4 months with no recorded response from the user.

@cometgrrl cometgrrl added the [Closed] Resolved Issue is resolved. Use for issues that can be closed but did not have an explicit fix with a PR. label Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Core Gallery block [Closed] Resolved Issue is resolved. Use for issues that can be closed but did not have an explicit fix with a PR. Images [Pri] Normal [Status] Core Fix Needed A fix within the Core WordPress or Gutenberg project is required to resolve this issue. [Type] Bug User Report This issue was created following a WordPress customer report
Projects
None yet
Development

No branches or pull requests

8 participants