Issue service-point-meta fatal error
-
On some woocommerce subscriptions our website runs into the following issue:
: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, string given in /var/x/website/html/webroot/public_html/wp-content/plugins/sendcloud-shipping/includes/Models/class-service-point-meta.php:105 Stack trace: 0 /var/x/website/html/webroot/public_html/wp-content/plugins/sendcloud-shipping/includes/Models/class-service-point-meta.php(105): array_key_exists() 1 /var/x/website/html/webroot/public_html/wp-content/plugins/sendcloud-shipping/includes/Repositories/class-service-point-meta-repository.php(23): Sendcloud\Shipping\Models\Service_Point_Meta::from_array() 2 /var/x/website/html/webroot/public_html/wp-content/plugins/sendcloud-shipping/includes/ServicePoint/class-checkout-handler.php(159): Sendcloud\Shipping\Repositories\Service_Point_Meta_Repository->get() 3 [internal function]: Sendcloud\Shipping\ServicePoint\Checkout_Handler->add_service_point_data_in_admin_order() 4 /var/x/website/html/webroot/public_html/wp-content/plugins/sendcloud-shipping/includes/Utility/class-logging-callable.php(28): call_user_func_array() 5 /var/x/website/html/webroot/public_html/wp-includes/class-wp-hook.php(308): Sendcloud\Shipping\Utility\Logging_Callable->__invoke() 6 /var/x/website/html/webroot/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() 7 /var/x/website/html/webroot/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() 8 /var/x/website/html/webroot/public_html/wp-content/plugins/woocommerce-subscriptions/includes/admin/meta-boxes/class-wcs-meta-box-subscription-data.php(302): do_action() 9 /var/x/website/html/webroot/public_html/wp-admin/includes/template.php(1445): WCS_Meta_Box_Subscription_Data::output() 10 /var/x/website/html/webroot/public_html/wp-admin/edit-form-advanced.php(688): do_meta_boxes() 11 /var/x/website/html/webroot/public_html/wp-admin/post.php(206): require('/var/hpwsites/u…') 12 {main} thrown inBy adjusting the code like this:
/** * Creates object from array * * @param $data * * @return Service_Point_Meta */ public static function from_array( $data ) { $service_point = new self(); $service_point->id = is_array($data) && array_key_exists( 'id', $data ) ? $data['id'] : ''; $service_point->extra = is_array($data) && array_key_exists( 'extra', $data ) ? $data['extra'] : ''; $service_point->post_number = is_array($data) && array_key_exists( 'post_number', $data ) ? $data['post_number'] : ''; return $service_point; }It enables us to be able to view the page again but this issue might have to do with something else. Is this the proper way to fix this or is there a different way (this will be gone on future updates)? and/or what else might be the problem.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Issue service-point-meta fatal error’ is closed to new replies.