-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Editing captions in the Gallery Block creates conflict #46813
Comments
I also have an example of this occurring and it seems to be that adding links to these captions is the issue. I found that once a link was applied that image broke on the front end. Whats odd is reverting to a revision when the image did load with a image caption that links to another page, it still is broken implying that a recent update to Gutenburg might be the culprit: 25080976-hc Going to be helping them add a list of image blocks instead with galleries as a work around. They were using the Luxury theme |
Looks like this is the same issue appearing on https://jgeilsband.wordpress.com/j-geils-band-atlantic-tapes-1970-1982/ |
I can reproduce on WP.com. The crucial part is to have a link in the image caption 👍 Going to test on vanilla Gutenberg now. |
Doesn't seem present in vanilla Gutenberg, so I'm suspecting some of WP.com's sanitization ( Edit: Note that in order to repro, you need to open the gallery block's sidebar, and make sure that in the 'Link to' dropdown, you select 'Media file': That setting wraps the <figure class="wp-block-gallery columns-3 is-cropped">
<ul data-carousel-extra='{"blog_id":89417913,"permalink":"https:\/\/example.com\/2020\/10\/28\/gallery\/"}'
class="blocks-gallery-grid">
<li class="blocks-gallery-item">
<figure><a
href="https://example.files.wordpress.com/2019/02/cat-pet-animal-domestic-104827-1.jpeg"><img
src="https://example.files.wordpress.com/2019/02/cat-pet-animal-domestic-104827-1.jpeg?w=580"
alt="<a href="https://example.com/">Caption</a></a>
<figcaption class="blocks-gallery-item__caption"><a
href="https://example.com/">Caption</a></figcaption>
</figure> Edit: Also note that the last character of the caption needs to be part of the link. (There's apparently no problem if only the beginning or middle parts of the caption are linked.) The reason seems to be that there's then two subsequent Edit: The resulting HTML seems to be a bit unpredictable on WP.com, possibly because of however WP.com sanitizes HTML, and e.g. closes an open HTML tag early, or leaves it overall empty. E.g. I've seen totally empty |
Another report of this 3445774-zen. The user will try the workaround mentioned in step 7 above. |
Potentially relevant GB PR: WordPress/gutenberg#26082 |
Another report:
(internal reference: 3446502-zen)
I tested and confirmed the bug, but I had to try editing captions a few different times and the problem seemed to happen after editing a pre-existing gallery, adding a new image, and then making the entire caption into a link. Post: https://made4testing0318.blog/2020/10/28/gallery/ Screenshot: Tested with Firefox 81.0.1 on macOS 10.15.6. |
Filed a request to fix the underlying GB issue: WordPress/gutenberg#26549 We might be able to tackle this at JP level, to get an expedited workaround. |
Seems to be an issue for captions that are added via the editor that do not exist in the media library. Example: https://personaltestsite123.wordpress.com/2020/10/29/2031/ Middle caption was added in the media library, hyperlink works fine. The third image I added the caption in the editor and it breaks the image. |
Yeah, captions set from the media library are really We're working on a fix here: WordPress/gutenberg#26574 |
Another in 23487450-hc. Will follow up once this is patched. |
Another related ticket zen-3450533 |
Another related: hc-25305530 |
Report from the WordPress.com forums: https://wordpress.com/forums/topic/lost-image-2/ Screen shot: https://d.pr/i/QWnhrH |
Report from the WordPress.com forums: #46813 There are linked screen shots in that thread. |
Another case in #23248587-hc. |
Another one here: #23545276-hc Showing in Editor and also front-end. Simple site on Stow theme. |
Another report in 3452471-zd |
Another case reported here 3458054-zd |
Hi, I have some more inputs from the user who reported the original issue on this thread:
Update: Looks like the bug fix has already taken effect on her website. Just now, I tried reproducing the bug using a test post on the user's site but I can no longer replicate the issue. Here's the test page https://bitchinchickens.com/2020/10/27/test-jade-artist-for-animals/. The last Image gallery with three pictures captioned "nov6" is the most recent one I used. Looks like it is working perfectly on my tests but still awaiting feedback from user to confirm. |
Another report in 3466824-zen |
Got another. They're using the TextBook theme: |
Another here: #21950117-hc and #3470026-zd Is there any workaround that anyone can find in the meantime without us having to completely recreate the page? I thought maybe removing the captions in the HTML might work but that doesn't seem to help. |
Another report in #3471922-zen |
Another report in 3471828-zen |
Update from original user who reported this issue: she tried Tiled Gallery and there were no issues uploading and publishing the images. However, captions are not supported so she would still prefer using Image Gallery block.
Hi @ockham, should the update apply by now on WordPress.com? Please advise. |
Hey @allanftd, we're still working on getting the 9.3 upgrade ready for WordPress.com. I'll update this issue once we've landed it. |
Thank you, @ockham! :) |
Another report in https://wordpress.com/forums/topic/gallery-glitch-2/. |
Also reported in 25568823-hc, follow-up for the user set up here: 3481646-zen |
Another report of this issue in 14297746-HC. Set up follow up here: 3482074-Zen |
Also reported in https://wordpress.com/forums/topic/image-links-not-working-2 |
Update from 3438940-zd: User said they scheduled a post and the photos disappeared after hitting the preview button. Only the captions boxes were left. When they tried again, the images completely disappeared from the editor as happened in the original issue. |
One more report here (in Spanish, sorry): https://wordpress.com/es/forums/topic/error-en-bloque-galeria/ After many tests, in my case, the problem appears when I convert a simple text caption of a picture into a link through the visual editor. It looks like the HTML conversion of the changes I made into the gallery has changed. Some of the content of the tags disappeared (I don't know why) and if you try to see the code, includes so much mistakes. here an example: https://happymondays.es/actrices-2/ Hope the developer can fix the problem SOON. |
Another report in 3489909-zen |
Another report in 25666333-hc. Follow-up at 3493156-zen. |
This should no longer occur per D52264-code (p9o2xV-19f-p2 for Atomic). Existing broken galleries unfortunately have to be fixed manually (e.g. by reverting to a previous revision of the post or page). |
Reopening, since we had to revert the 9.3.0 upgrade 😕 |
25728275-hc / 3500403-zen |
Closing this per the discussion in p1605780791157700-slack-wpcom-happy-announce. This was resolved with the re-release of Gutenberg 9.3 on simple sites. This release will not resolve the issue on existing galleries. To fix those, users will need to either:
|
Date from the user's report: October 26th
After editing some captions from the images in the gallery block, images are not visible anymore
Steps to reproduce
Add a gallery block.
Edit the image captions from the Gallery block on the editor.
Images are replaced by a white/gray square. Screenshot: https://prnt.sc/v79cse
If images are replaced, a link is displayed. Screenshot: https://prnt.sc/v78lf1
I created a new test post on the user's site, and the result was the same. Images disappear after adding/editing the image caption on the editor.
Images and captions are displayed correctly when editing captions on the media library. Screenshot: https://prnt.sc/v79mn9
Suggested the user editing the image caption in the media library before placing them in a gallery block, and replace the gallery blocks for new ones. It worked, but there are other posts with the same issue too:
http://bitchinchickens.com/2020/10/01/case-study-burn-survivors/ Screenshot: https://prnt.sc/v7ytvp
Context / Source
25176210-hc
3438940-zd
Screenshot:
https://prnt.sc/v78lf1
https://prnt.sc/v79cse
https://prnt.sc/v7ytvp
The text was updated successfully, but these errors were encountered: