PHP Fatal error – Uncaught Error: [] operator not supported for strings
-
Hello WooCommerce Custom Product Tabs Lite developers,
On PHP 7.1 we get the following error in the WordPress admin environment while editing a WooCommerce product:
[Mon Mar 20 11:12:27.583687 2017] [proxy_fcgi:error] [pid 15464:tid 139724714784512] [client 95.97.219.235:49790] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: [] operator not supported for strings in /public_html/wp-content/plugins/woocommerce-custom-product-tabs-lite/woocommerce-custom-product-tabs-lite.php:200\nStack trace:\n#0 /public_html/wp-includes/class-wp-hook.php(298): WooCommerceCustomProductTabsLite->product_write_panel('')\n#1 /public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)\n#2 /public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)\n#3 /public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-product-data.php(575): do_action('woocommerce_pro...')\n#4 /public_html/wp-admin/includes/template.php(1048): WC_Meta_Box_Product_Data::output(Object(WP_Post), Array)\n#5 /public_html/wp-admin/edit...\n', referer: /wp-admin/edit.php?post_type=product&wc-hide-notice=template_files&_wc_notice_nonce=87a9ba7165
This can be fixed easily with the following change:
$tab_data[] = array( 'title' => '', 'content' => '' );
to
$tab_data = array( array( 'title' => '', 'content' => '' ) );
Would be nice if you apply this in the next release!
- The topic ‘PHP Fatal error – Uncaught Error: [] operator not supported for strings’ is closed to new replies.