PHP 8.4: Implicitly nullable parameter deprecation causes editor not loading
-
Hello My Calendar development team,
I’ve encountered an issue while using the latest version of your plugin on a WordPress site running PHP 8.4. Specifically, attempting to open the post editor leads to a blank page—no editor interface appears—until I deactivate the My Calendar plugin.
I checked the debug.log and found numerous “Deprecated” notices related to the plugin components, such as:
- Spatie\IcalendarGenerator\Components\CustomEvent::create(): Implicitly marking parameter $name as nullable is deprecated…
- ActionScheduler_Store::save_action(): Implicitly marking parameter $scheduled_date as nullable is deprecated…
- (and multiple similar notices)
These indicate that the plugin’s code uses parameter declarations like:
function example(string $param = null) { … }
Which PHP 8.4 flags as deprecated, and now recommends using:
function example(?string $param = null) { … }See official PHP recommendation: PHP 8.4 deprecates implicitly nullable parameters — explicit nullable type must be used instead (https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated)
This seems to not just be a warning—when My Calendar is activated, the WordPress post editor (Gutenberg or Classic) fails to load, showing a blank screen. Deactivating the plugin resolves the issue and restores the editor functionality.
Steps to reproduce:
- Enable My Calendar plugin on a WordPress site with PHP 8.4.
- Attempt to create or edit a post.
- The editor fails to load (blank page), and deprecation notices appear in debug.log.
- Deactivating the plugin restores the editor.
Suggested fix:
Please update the plugin code (and related dependencies, like Spatie iCalendarGenerator and ActionScheduler) to use explicit nullable types (?Type $param = null) instead of implicit ones. This would ensure PHP 8.4 compatibility and prevent editor loading issues.Thank you for your attention to this matter!
The topic ‘PHP 8.4: Implicitly nullable parameter deprecation causes editor not loading’ is closed to new replies.