Problem/Motivation

After updating to 8.x-4.7, clicking Scan Library throws IncompleteLibraryDefinitionException for google-api-php-client. The same exception can prevent the OAuth and service-account add forms from opening.

The 8.x-4.7 change for #3439426 removed the empty dependencies entry from the PHP-only library definition. Drupal asset discovery does not recognize php as an asset type, so the definition no longer has a recognized key and is rejected before the Composer-installed client can be detected.

Steps to reproduce

  1. Install 8.x-4.7 on a fresh Drupal site using Composer.
  2. Visit /admin/structure/google_api_client_settings.
  3. Click Scan Library.

Drupal reports an incomplete library definition for google-api-php-client.

Proposed resolution

  • Declare a valid empty dependency array for the legacy PHP-only library definition.
  • Detect the Composer-autoloaded Google client before falling back to Drupal library discovery.

Remaining tasks

  • Review and merge the fix.
  • Create an 8.x-4.8 bug-fix release.

User interface changes

None. The Scan Library button and account forms work again.

API changes

None.

Data model changes

None.

Command icon 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

elaman created an issue. See original summary.

  • elaman committed 7e194046 on 8.x-4.x
    Issue #3611831: Fix PHP-only library discovery
    
elaman’s picture

Status: Active » Fixed

MR !20 has been merged into 8.x-4.x. The fix is available in the 8.x-4.8 release: https://www.drupal.org/project/google_api_client/releases/8.x-4.8

Verified on Drupal 11.4.4 with PHP 8.4.22. Scan Library completes successfully, and both OAuth and service-account clients can be configured and instantiate the Google Sheets service.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • elaman committed 7e194046 on 5.x
    Issue #3611831: Fix PHP-only library discovery
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.