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

v0.3.12 #148

Merged
merged 36 commits into from
May 19, 2022
Merged

v0.3.12 #148

merged 36 commits into from
May 19, 2022

Conversation

pristas-peter
Copy link
Owner

No description provided.

pristas-peter and others added 30 commits March 27, 2021 20:08
Meant to be an analogue to `blocksJSON`, but it can be useful as a
fallback if one wants to handle unknown/generic blocks.
`wp-graphql-gutenberg` couldn't handle requests when it found
block types which are not in the registry.  This can happen if a block
type is removed but the block is still used in a post.

Now both `blocksJSON` and `blocks` can be queried when unknown blocks
are present.
Update BlockEditorContentNode.php
Add dynamic content to Block class.
Some block types (e. g. ACF block types) are added during page load. So the return value of window.wp.blocks.getBlockTypes() changes during page load.
Inside the iFrame window when accessing the window.wp.blocks.getBlockTypes() function to get the block types we should wait for the page to load to get all block types.
Wait for all block types to load before updating
- Add `eagerlyLoadType => true` to Block Types that are only exposed to the Schema as part of the `Blocks` Interface
- Add condition where Block types should only be registered if they have fields.
…ng, so registering a type adds a callback to the registry instead of the full Type Definition and the Schema Type Loader generates the object on demand, so this is no longer needed to be filtered
…-1.6

Updates to work with WPGraphQL v1.6+
Fixed:
- `$attributes` nested arrays threw TypeError in PHP 8.0, this was a
  warning in PHP 7.4.  Fixed by converting nested arrays to objects as
  well.
…ilter

Add filter to modify the block attributes
Fixes:
- If a block has an empty `$attributes` array (e.g. a normal paragraph),
  then reading attributes saved in the HTML did not work.  This was
  because the conversion of an empty array to an object did not work.
- PHP ≥ 8.0 no longer crashes when `innerHTML` is an empty string.  This
  problem was only visible once the empty array conversion was fixed.
Fixed:
- There are some core dynamic blocks which takes three arguments in
  their render function, but the `WP_Block_Type::render()` function
  will only supply two, which means that if a post/page contains any such
  block then the query will crash.  Using the `render_block()` function
  works though, and I suppose that is the 'correct' API to use in this
  case.

  Here are the core blocks affected by this (which will crash the query
  if present on a post/page):
  - `core/comment-author-avatar`
  - `core/comment-author-name`
  - `core/comment-content`
  - `core/comment-date`
  - `core/comment-edit-link`
  - `core/comment-reply-link`
  - `core/comment-template`
  - `core/comment-pagination-next`
  - `core/comment-pagination-numbers`
  - `core/comment-pagination-previous`
  - `core/home-link`
  - `core/navigation-link`
  - `core/navigation-submenu`
  - `core/navigation`
  - `core/page-list`
  - `core/post-author-biography`
  - `core/post-author-name`
  - `core/post-author`
  - `core/post-comments-count`
  - `core/post-comments-form`
  - `core/post-comments-link`
  - `core/post-comments`
  - `core/post-content`
  - `core/post-date`
  - `core/post-excerpt`
  - `core/post-featured-image`
  - `core/post-template`
  - `core/post-terms`
  - `core/post-title`
  - `core/query-pagination-next`
  - `core/query-pagination-numbers`
  - `core/query-pagination-previous`
  - `core/read-more`
  - `core/social-link`
  - `core/table-of-contents`
  - `core/widget-group`
@pristas-peter pristas-peter merged commit b8177d3 into master May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants