Problem/Motivation
The 4.x branch supports Drupal 8 through 11 and retains a very old PHP compatibility baseline. That broad compatibility prevents us from adopting current Drupal APIs and modern PHP practices cleanly. Drupal 11.3 reports deprecations, including the legacy requirements hook warning tracked in #3609690, and the module also has PHPStan findings that should be resolved.
The 5.x major release will provide a clean compatibility boundary. It will drop Drupal 8, 9, and 10, support Drupal 11 and 12 properly, and allow general improvements that are not suitable for the 4.x maintenance branch.
Goals
- Support Drupal 11.3 or newer and Drupal 12.
- Require PHP 8.3 or newer. Drupal 12 installations will require PHP 8.5 through Drupal core.
- Resolve Drupal 11 and 12 deprecations.
- Establish and pass an agreed PHPStan level.
- Add automated coverage for authentication, token refresh, invalid grants, revocation, and service-account clients.
- Modernize dependency injection, type declarations, and service definitions where doing so improves maintainability.
- Preserve existing configuration and provide a documented upgrade path from 4.x.
Proposed resolution
Create a 5.x branch from the latest 8.x-4.x release with the following baseline:
core_version_requirement: ^11.3 || ^12php: >=8.3- Supported releases of
google/apiclientandgoogle/apiclient-services
Keep 8.x-4.x as the maintenance branch for existing sites. Limit it to important bug and security fixes while 5.x is developed.
Planned child work
- Update core, PHP, Composer, and Google client dependency requirements.
- Replace deprecated procedural hooks with supported Drupal 11 and 12 implementations.
- Resolve PHPStan findings and define the enforced analysis level.
- Modernize services and dependency injection.
- Review public interfaces and add safe PHP type declarations.
- Consolidate and test token validation, refresh, revocation, and error handling.
- Add a Drupal 11 and 12 test matrix.
- Document breaking changes and the 4.x to 5.x upgrade path.
Non-goals
- Do not change configuration identifiers or discard stored client configuration without a migration path.
- Do not combine all modernization work into one large merge request. Each child issue should remain focused and independently reviewable.
Definition of done
- Drupal 11 and 12 compatibility checks pass.
- Supported PHP versions pass automated checks.
- No known Drupal deprecation warnings remain.
- Authentication and token lifecycle tests pass.
- The upgrade path and breaking changes are documented.
- A 5.0.0-alpha1 release is ready for contributed-module testing.
Issue fork google_api_client-3611819
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 #2
elamanComment #3
elamanI've turned this into a 5.x meta issue. First to tackle is to add basic support for 11 and 12. I will work on it next week.
Comment #5
tolstoydotcomI created a merge request that has my changes. I don't think I changed anything that had been changed since I started doing this. I'm doing this for internal use and I'll only add more to the MR if I notice something during testing.