[BUG] Fatal error in Admin.php – Call to get_prefix() on string (PHP 8.1)
-
Hello,
I’m experiencing a fatal error in the WooCommerce admin order screen when using PDF Invoices & Packing Slips for WooCommerce. Environment
- WordPress: 6.9
- WooCommerce: current (latest stable)
- Plugin: PDF Invoices & Packing Slips for WooCommerce 5.6.0
- PHP: 8.1
- Hosting: All-Inkl
Description
The shop frontend works perfectly:
- Orders are placed successfully
- Payments (Mollie) are completed
- Emails are sent
- PDF invoices are generated correctly
However, when opening an order in the WooCommerce backend, the metabox “PDF Document Data” shows a critical error and the admin page breaks partially. Error message
Fatal error: Uncaught Error: Call to a member function get_prefix() on string
in wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/Admin.php:990This seems to happen while loading the admin metabox.
Even disabling the metabox via hooks does not help, which suggests the error occurs during file load. Notes- The issue also occurred with PHP 8.5 (worse), PHP 8.1 reduced it to backend-only
- Downgrading PHP is not preferred for security reasons
- Downgrading the plugin has not been tested yet
- This looks like a compatibility issue with PHP 8.x in the admin code
Question
Is this a known bug in version 5.6.0?
Is there a planned fix or recommended workaround (besides downgrading the plugin)?Thanks for your work on the plugin and any guidance you can provide.
Best regards
You must be logged in to reply to this topic.