Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoloader: deprecation notice when using PHP 8.3 #37172

Closed
lifeforceinst opened this issue May 2, 2024 · 2 comments · Fixed by #37174
Closed

Autoloader: deprecation notice when using PHP 8.3 #37172

lifeforceinst opened this issue May 2, 2024 · 2 comments · Fixed by #37174
Assignees
Labels
[Focus] Compatibility Ensuring our products play well with third-parties [Package] Autoloader [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@lifeforceinst
Copy link

lifeforceinst commented May 2, 2024

Impacted plugin

Jetpack

Quick summary

After installing latest Ubuntu server 24.04 with PHP 8.3.6 and loading up WordPress 6.5.2 and porting across the database and then loading WooCommerce. If debugging is enabled, the following error message is generated.

strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html3/mylf/wp-content/plugins/woocommerce/vendor/jetpack-autoloader/class-path-processor.php on line 132

This indicates that a guard rail should be provided in this function to deal with strlen() being passed a null paramater.

Steps to reproduce

1 Install ubuntu 24.04 wwith PHP 8.3.6 and other necessary applications.
2 Install WordPress 6.5.2.
3 Port across MySQL database.
4 Enable debug in wp-config.php with define('WP_DEBUG', true); and define('WP_DEBUG_LOG', true);
5 Install WooCommerce.
6 As soon as WooCommerce is loaded, the error is displayed on admin console and in error logs.

A clear and concise description of what you expected to happen.

There should be no message about depreciated call.

After reporting to WooCommerce sithub at woocommerce/woocommerce#47001 this was closed saying to report the issue to Jetpack.

What actually happened

WooCommerce: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/wp-content/plugins/woocommerce/vendor/jetpack-autoloader/class-path-processor.php on line 132

Impact

All

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Self-hosted

Logs or notes

Ubuntu 24.04
Server Info: Apache/2.4.58 (Ubuntu)
PHP Version: 8.3.6
WordPress: 6.5.2
WooCommerce : 8.8.2

@lifeforceinst lifeforceinst added [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels May 2, 2024
@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] High [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack labels May 2, 2024
@jeherve jeherve changed the title Passing null to parameter #1 ($string) in jetpack-autoloader/class-path-processor.php PHP 8.3 Autoloader: deprecation notice when using PHP 8.3 May 2, 2024
@jeherve jeherve added [Package] Autoloader [Pri] Normal [Focus] Compatibility Ensuring our products play well with third-parties Triaged and removed [Pri] High Needs triage Ticket needs to be triaged labels May 2, 2024
@jeherve
Copy link
Member

jeherve commented May 2, 2024

Thanks for the report, we'll take a look at this and update this issue once we make progress on that.

@anomiex
Copy link
Contributor

anomiex commented May 2, 2024

I was unable to reproduce this following the instructions given. Unless it's specific to Ubuntu 24.04 somehow and won't reproduce on Debian bullseye with PHP 8.3 installed.

Examining the relevant code, the one caller of that private method passes output from wp_normalize_path(), and that function always returns a string. So either I'm missing something, or something is very weird in the reporter's environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Compatibility Ensuring our products play well with third-parties [Package] Autoloader [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended
Development

Successfully merging a pull request may close this issue.

3 participants