Problem/Motivation
The Video module in Drupal is generating multiple PHP deprecation warnings related to implicitly marking parameters as nullable. These warnings indicate that the codebase needs to be updated to use explicit nullable types to comply with modern PHP standards. This is causing noise in logs and potential compatibility issues with newer PHP versions.
Steps to reproduce
- Install the Video module in a Drupal environment running PHP 8.4 or higher.
- Enable deprecated error logging in PHP configuration (e.g., error_reporting(E_ALL | E_DEPRECATED)).
- Clear cache with drush cr or Trigger actions or settings forms related to the Video module (e.g., configure a redirect, access denied, or page not found behavior).
- Enable deprecated error logging in PHP configuration (e.g., error_reporting(E_ALL | E_DEPRECATED)).
- Deprecated: Drupal\video\StreamWrapper\VideoRemoteStreamWrapper::basePath(): Implicitly marking parameter $site_path as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/public_html/modules/contrib/video/src/StreamWrapper/VideoRemoteStreamWrapper.php on line 53
Proposed resolution
Update the Video module's codebase to use explicit nullable types (e.g., ?Type) for the affected parameters in the following files:
VideoRemoteStreamWrapper.php
This will eliminate the deprecation warnings and ensure compatibility with PHP standards moving forward.
Remaining tasks
- Implement the proposed changes in the module's source code.
- Test the updated module to ensure functionality remains intact.
User interface changes
None
API changes
None
Data model changes
None
Issue fork video-3612970
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
nachosalvador commentedComment #4
nachosalvador commentedComment #5
nachosalvador commentedComment #6
nachosalvador commentedComment #7
sagesolutions commentedTested and works as expected. Marking as RTBC
Comment #8
vinodhini.e commentedTested on Drupal 10.6.10 with PHP 8.4.
I was able to reproduce the reported deprecation warning. After applying MR #34 and retesting, the deprecation notice was no longer displayed.
+1 RTBC.