-
Notifications
You must be signed in to change notification settings - Fork 3
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
Broken block editor because of uncatched fatal error in field JSON serialization #78
Comments
A possible solution is: $data['options'] = [];
try {
$data['options'] = $this->get_flat_options();
} catch ( \Exception $e ) {
$data['error'] = $e->getMessage();
}
return $data; But the question is also why is there an I know we use the field JSON for the
The
We currently also use
Apart from this I think it is correct to add a try catch in |
I just came across a broken block editor (Classic block) because a fatal error occurred during JSON serialization of a field.
wp-pay-core/src/Fields/SelectField.php
Lines 100 to 112 in 7baee62
The gateway configuration had invalid credentials and the option were retrieved through a
IDealIssuerSelectField
class.The issue was triggered from WooCommerce via the JSON encode of
$this->data
in https://github.com/woocommerce/woocommerce-blocks/blob/2ff8573d5426ebee180e50539f113c211362d1b9/src/Assets/AssetDataRegistry.php#L348-L373Internal Help Scout ticket: https://secure.helpscout.net/conversation/2036688566/24611
The text was updated successfully, but these errors were encountered: