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

Blocks/FSE: Session Speakers Block encounters error when added to custom single template (Session) #832

Closed
thomasplevy opened this issue Feb 17, 2023 · 0 comments · Fixed by #851
Assignees
Labels
[Component] Blocks All custom blocks (Speakers, CrowdCast, Live Schedule, etc) [Type] Bug

Comments

@thomasplevy
Copy link

Describe the bug

I noticed this while building out a site. I'm currently reverting to use the [speakers] shortcode instead as I don't want to add the block to each session independently.

To reproduce

Steps to reproduce the behavior:

  1. On Twenty Twenty-Three theme
  2. Using FSE create a new Single Item template for the Sessions post type
  3. Add the Session Speakers Block to the template
  4. The block encounters a preview error and doesn't render.

Error in the console from minified JS (maybe helpful?)

An error occurred while running 'mapSelect': t(...) is undefined [index.js:183:12](webpack://wp/packages/data/build-module/components/use-select/@wordpress/data/src/components/use-select/index.js)

The block works as expected when added directly to a Session post. Perhaps it's not supposed to work in FSE?

Expected behavior

Block would render without error

Screenshots

Screenshot from 2023-02-17 11-19-26

WordCamp

https://phoenix.wordcamp.org/2023/wp-admin/site-editor.php?postType=wp_template&sidebar=%2F&postId=twentytwentythree%2F%2Fsingle-wcb_session

System (please complete the following information):

  • Device: Laptop
  • OS: Ubuntu 22.04
  • Browser: Firefox
  • Version: 110.0
@ryelle ryelle added [Type] Bug [Component] Blocks All custom blocks (Speakers, CrowdCast, Live Schedule, etc) labels Mar 16, 2023
ryelle added a commit that referenced this issue Mar 17, 2023
If used in the post editor, these are valid and reflect the current post. If used in the template editor, these are null, and the block should display a placeholder value. This will display the placeholder value in the template editor regardless of sessions (published or not) on the site.

Fixes #829, fixes #832
ryelle added a commit that referenced this issue Mar 20, 2023
If used in the post editor, these are valid and reflect the current post. If used in the template editor, these are null, and the block should display a placeholder value. This will display the placeholder value in the template editor regardless of sessions (published or not) on the site.

Fixes #829, fixes #832
@ryelle ryelle self-assigned this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Blocks All custom blocks (Speakers, CrowdCast, Live Schedule, etc) [Type] Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants