Fatal error em PHP 8.1 – Cannot access offset of type string on string
-
Usando o PHP 8.1, o plugin quebrou o admin do WooCommerce com erro fatal.Passo a passo pra reproduzir
- Ative o plugin na versão 2.4.3.
- Com PHP ≥ 8.1 ativo, abra um pedido no admin:
- /wp-admin/admin.php?page=wc-orders&action=edit&id=123.
- A tela cai direto em erro 500.
StackTrace
Uncaught TypeError: Cannot access offset of type string on string in wp-content/plugins/woo-boleto-paghiper/includes/class-wc-paghiper-admin.php:129 Stack trace: #0 wp-admin/includes/template.php(1456): WC_Paghiper_Admin->metabox_content() #1 wp-content/plugins/woocommerce/src/Internal/Admin/Orders/Edit.php(502): do_meta_boxes() ...Raiz do problema
$transaction às vezes chega como string JSON, não array.
No PHP 8.1 a tentativa de ler $transaction[‘bar_code_url’] gera fatal.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Fatal error em PHP 8.1 – Cannot access offset of type string on string’ is closed to new replies.