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

CoBlocks: Logos & Badges, Masonry, Stacked have missing images in Preview #37096

Closed
zdenys opened this issue Oct 26, 2019 · 6 comments
Closed
Assignees
Labels
Blocks Editor blocks, aka Gutenberg blocks, plugins, and extensions [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Bug

Comments

@zdenys
Copy link
Contributor

zdenys commented Oct 26, 2019

Steps to reproduce

  1. Starting at URL: WordPress.com > My Sites > Site > Pages/Post > Add New
  2. Click ⨁ on top left
  3. Hover over CoBlocks Logos & Badges or CoBlocks Galleries: Masonry or CoBlocks Galleries: Stacked

What I expected

See a preview image

What happened instead

Preview image is missing

Chrome Inspector shows 404 for images like these:

https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/logo-1.jpg
https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/logo-2.jpg

https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/gallery-1.jpg
https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/gallery-2.jpg
https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/gallery-3.jpg
https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/gallery-4.jpg
https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/gallery-5.jpg
https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/gallery-6.jpg
https://SITEADDRESS.wordpress.com/wp-content/plugins/coblocks/dist/images/examples/gallery-7.jpg

Screenshot / Video


Link: https://cld.wthms.co/J4xTRD

Context / Source

#ust-bugreport in pb1bze-ej-p2

@zdenys zdenys added [Type] Bug [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Defect Blocks Editor blocks, aka Gutenberg blocks, plugins, and extensions labels Oct 26, 2019
@gwwar
Copy link
Contributor

gwwar commented Oct 30, 2019

@kwight do you mind confirming?

@kwight
Copy link
Contributor

kwight commented Oct 30, 2019

Ah, yes, it even makes sense: the URLs don't take into account our versioned directories (/wp-content/plugins/coblocks/1.16.1/dist/images/examples/logo-1.jpg). We also should be serving from static (s0-3.wp.com). I'll see if I can hook in somewhere.

@kwight
Copy link
Contributor

kwight commented Oct 30, 2019

Hm, they're all hardcoded. We may be able to filter the block settings though (maybe hang our URLs from wpcomGutenberg?).

@gwwar
Copy link
Contributor

gwwar commented Oct 30, 2019

Hm, they're all hardcoded.

🤔 not sure how open folks would be to being able to config the path dir upstream. Might be worth a shot.

We can modify the block settings if needed, something like:

const changeBlockPreviews = ( settings, name ) => {
	if ( 'coblocks' === settings.category ) {
		// mutate block settings
	}
	if ( 'coblocks-gallery' === settings.category ) {
		// mutate block settings
	}
	return settings;
} );

addFilter( 'blocks.registerBlockType', 'wpcom/coblocks', changeBlockPreviews )

@mmtr
Copy link
Member

mmtr commented Nov 14, 2019

Noting that this will be automatically fixed once we activate 1.17.1 on production since block previews use now images hotlinked from Wikimedia Commons: godaddy-wordpress/coblocks#1106

@kwight
Copy link
Contributor

kwight commented Nov 15, 2019

We'll be pushing out a modified 1.17.1-wpcom, that is v1.17.1 plus godaddy-wordpress/coblocks#1134 – that will close this, while keeping images kosher.

@mmtr mmtr closed this as completed Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocks Editor blocks, aka Gutenberg blocks, plugins, and extensions [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants