Skip to content

Invalid use of Gutenberg block function in a non-block context. #2599

@Soare-Robert-Daniel

Description

@Soare-Robert-Daniel

Description

We are using get_block_wrapper_attributes() in the context for wp_load hook, which creates a conflict since the WP internal self::$block_to_render is not initialised in this context, thus reporting: Warning: Trying to access array offset on value of type null

https://github.com/Codeinwp/otter-blocks/blob/master/inc/render/class-stripe-checkout-block.php#L65

Suggested changes

Remove the usage of the block functions in this context.

Step-by-step reproduction instructions

  1. Use a URL that only has action=buy_stripe.
  2. Check the WordPress instance error logs.

Screenshots, screen recording, code snippet or Help Scout ticket

No response

Environment info

No response

Is the issue you are reporting a regression

Yes, this is a regression.

Metadata

Metadata

Assignees

Labels

bugThis label could be used to identify issues that are caused by a defect in the product.regressionIssue represents a change in behavior from a previous version that is not intended or desired..

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions