WPIntell

Source evidence

Fatal Error

mPDF add-on for RTL and Unicode Support · support · 2024-09-09T21:07:00+00:00

neutralsentiment
highseverity
0.63relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

3 / 31 rows with source links

9.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
ablears resolved
>PHP Fatal error: Declaration of Psr\Log\NullLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerInterface::log($level, Stringable|string $message, array $context = []): void in /var/www/z/wp-content/plugins/mpdf-addon-for-pdf-invoices/vendor/psr/log/Psr/Log/NullLogger.php on line 26 PHP 8.1 Plugin version 1.2.1 This causes a fatal error whenever an order is marked as complete (hence generating the invoice). Refreshing the page shows the order page correctly but trying to download the invoice triggers the error too. I changed line 26 to: public function log($level, $message, array $context = []): void That fixed the error. Is this something you can add to the next release? Hi @ablears , Thanks for reaching out. We were unable to replicate the error mentioned, which seems to be related to the PSR NullLogger. We can confirm that the NullLogger is fully compatible with the LoggerInterface. Applying the suggested code changes may result in a fatal error. Additionally, it seems that the LoggerInterface code is unrelated to our plugin. Kindly check. Our LoggerInterface is defined as follows: Psr\Log\LoggerInterface::log($level, $message, array $context = []) The reported LoggerInterface is defined as follows: Psr\Log\LoggerInterface::log($level, Stringable|string $message, array $context = []): void I had to make the code change to your plugin to prevent the fatal errors. I’m not sure what else I can do, considering this is the only plug-in that generates this error on our WordPress network. I had a look on the server, searching for other instances of Psr\Log\LoggerInterface::log and found that WooCommerce was logging errors on one domain only on this network, and that is the one showing the error. It backtraces to woocommerce/includes/class-woocommerce.php. 3:2024-09-09T20:22:02+00:00 CRITICAL Declaration of Psr\Log\NullLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerInterface::log($level, Stringable|string $message, array $context = []): void CONTEXT: {“error”:{“type”:64,”file”:”/var/www/z/wp-content/plugins/mpdf-addon-for-pdf-invoices/vendor/psr/log/Psr/Log/NullLogger.php”,”line”:26},”backtrace”:[{“file”:”/var/www/z/wp-content/plugins/woocommerce/includes/class-woocommerce.php”,”line”:359,”function”:”critical”,”class”:”WC_Logger”,”type”:”->”},{“function”:”log_errors”,”class”:”WooCommerce”,”type”:”->”}]} Running ack 'LoggerInterface' . showed a number of themes and plugins using it, but mpdf is the only one that generates a fatal error. This reply was modified 1 year, 8 months ago by ablears . Reason: more detail Hi @ablears , We have fixed the issue in the latest release of the plugin. You may update the plugin to its latest version and check.

Comments

4 shown
WebToffee Support 2024-09-11T13:00:00+00:00

Hi @ablears , Thanks for reaching out. We were unable to replicate the error mentioned, which seems to be related to the PSR NullLogger. We can confirm that the NullLogger is fully compatible with the LoggerInterface. Applying the suggested code changes may result in a fatal error. Additionally, it seems that the LoggerInterface code is unrelated to our plugin. Kindly check. Our LoggerInterface is defined as follows: Psr\Log\LoggerInterface::log($level, $message, array $context = []) The reported LoggerInterface is defined as follows: Psr\Log\LoggerInterface::log($level, Stringable|string $message, array $context = []): void

ablears 2024-09-11T19:19:00+00:00

I had to make the code change to your plugin to prevent the fatal errors. I’m not sure what else I can do, considering this is the only plug-in that generates this error on our WordPress network.

ablears 2024-09-11T21:29:00+00:00

I had a look on the server, searching for other instances of Psr\Log\LoggerInterface::log and found that WooCommerce was logging errors on one domain only on this network, and that is the one showing the error. It backtraces to woocommerce/includes/class-woocommerce.php. 3:2024-09-09T20:22:02+00:00 CRITICAL Declaration of Psr\Log\NullLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerInterface::log($level, Stringable|string $message, array $context = []): void CONTEXT: {“error”:{“type”:64,”file”:”/var/www/z/wp-content/plugins/mpdf-addon-for-pdf-invoices/vendor/psr/log/Psr/Log/NullLogger.php”,”line”:26},”backtrace”:[{“file”:”/var/www/z/wp-content/plugins/woocommerce/includes/class-woocommerce.php”,”line”:359,”function”:”critical”,”class”:”WC_Logger”,”type”:”->”},{“function”:”log_errors”,”class”:”WooCommerce”,”type”:”->”}]} Running ack 'LoggerInterface' . showed a number of themes and plugins using it, but mpdf is the only one that generates a fatal error. This reply was modified 1 year, 8 months ago by ablears . Reason: more detail

WebToffee Support 2024-09-20T05:36:00+00:00

Hi @ablears , We have fixed the issue in the latest release of the plugin. You may update the plugin to its latest version and check.