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

VideoPress: VideoPress Video block outputs null #25950

Closed
retrofox opened this issue Aug 31, 2022 · 1 comment · Fixed by #26578
Closed

VideoPress: VideoPress Video block outputs null #25950

retrofox opened this issue Aug 31, 2022 · 1 comment · Fixed by #26578
Assignees
Labels
[Block] VideoPress [Package] VideoPress [Type] Bug When a feature is broken and / or not performing as intended

Comments

@retrofox
Copy link
Contributor

The VideoPress Video block outputs null in the front end when the block doesn't have a defined video.

Block editor Front-end
Image Image
@dhasilva dhasilva self-assigned this Sep 20, 2022
@dhasilva
Copy link
Contributor

The null output happens here, when videoPressUrl is null: https://github.com/Automattic/jetpack/blob/trunk/projects/packages/videopress/src/client/block-editor/blocks/video/save.js#L67

<div className="jetpack-videopress-player__wrapper">
	{ `\n${ videoPressUrl }\n` /* URL needs to be on its own line. */ }
</div>

A simple check fixes this:

{ videoPressUrl && (
	<div className="jetpack-videopress-player__wrapper">
		{ `\n${ videoPressUrl }\n` /* URL needs to be on its own line. */ }
	</div>
) }

The problem is that this triggers the block's validation, as the save content is different from what was previously saved to the database:

Screenshot_2022-09-20_16-35-50

The block user would need to manually update the offending block instances which, to be fair, I think should not be a problem as we are talking about a specific case that should not be common.

There is an issue about this, for reference: WordPress/gutenberg#7604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] VideoPress [Package] VideoPress [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants