I've uploaded the most recent version to sites/all/libraries, Libraries 7.x-2.0 is installed, and Google Cloud Storage 7.x-1.x-dev is installed, and all of the information is up to date at admin/config/media/google-cloud-storage. However, when I visit /update.php, or when I try to save the page at admin/config/media/google-cloud-storage, I get the following error message.

Google's APIs Client Library for PHP was not loaded.

On the /update.php page it also says:

Google APIs Client Library for PHP Failed to load the Google APIs Client Library for PHP
Please make sure the Google APIs Client Library for PHP is installed in the libraries directory (libraries\google-api-php-client).

Any ideas? I'd really love to use this...

CommentFileSizeAuthor
#9 1852388-9.patch812 byteskevinn

Comments

ufku’s picture

Priority: Normal » Critical

New releases of the library does not include makeRelease.sh on which this module depends for detecting the library version.
Since the version is not detectable and there is no use of it, the library definition can simply include a hardcoded version.

/**
 * Implements hook_libraries_info().
 */
function google_cloud_storage_libraries_info() {
  return array(
    'google-api-php-client' => array(
      'title' => 'Google APIs Client Library for PHP',
      'vendor url' => 'http://code.google.com/p/google-api-php-client/',
      'download url' => 'http://code.google.com/p/google-api-php-client/downloads/list',
      'version' => 'undetectable',
      'files' => array(
        'php' => array(
          'src/Google_Client.php',
        ),
      ),
    ),
  );
}
Anonymous’s picture

Ok. So that looks like it should replace lines 172 - 192 in google_cloud_storage.module, right?

Anonymous’s picture

By the way everyone....the above does resolve this issue of "not loading" or "not installed". Replace the code in lines 172 - 192 in google_cloud_storage.module with the code in comment #1 (minus the php tags, duh), then make sure you flush caches.

Thanks ufku!

Any chance you also know the answer to the "next" error message coming up for me? It's "What is the proper info needed for admin/config/media/google-cloud-storage?" (http://drupal.org/node/1855210)

Anonymous’s picture

Status: Active » Fixed
ufku’s picture

Status: Fixed » Active

This is not fixed.

Anonymous’s picture

Sorry. I marked it as fixed because your solution worked for me.

alifopensrc’s picture

Issue summary: View changes

Any update on this?

-AOS.

steve.colson’s picture

Status: Active » Closed (outdated)

Closing out of date issue. It looks like this was fixed in the 2.x branch in commit b3312cc8efdc1512f9a389f6ddd3fcc6e758082d.

If anyone still needs pointers on this, grab the 2.x zip and take a look at google_cloud_storage.module. In function google_cloud_storage_libraries_info(), this can more or less be moved entirely to the 1.x branch (but the actual exercise is left to the reader).

kevinn’s picture

StatusFileSize
new812 bytes

This issue exists for version 2.0-beta1 of this module and v2.9.1 of google api php client library.
Here comes a patch to fix this issue.

steve.colson’s picture

Good catch. This patch should probably go in a new issue rather than reopening a multi-year old one though.

At the time of 2.x beta1 and dev, client was in the google folder and the code was correct. Not sure when they changed the structure.

smurfxx’s picture

How can I edit the function google_cloud_storage_libraries_info() to make module works with latest version of google api php client v2.12.6?

I tried to edit some lines to make it detect correctly the library but it doesn't work:

function google_cloud_storage_libraries_info() {
  return array(
    'google-api-php-client' => array(
      'title' => 'Google APIs Client Library for PHP',
      'vendor url' => 'https://github.com/googleapis/google-api-php-client',
      'download url' => 'https://github.com/googleapis/google-api-php-client/releases',
      'version arguments' => array(
        'file' => 'src/Client.php',
        'pattern' => '/const LIBVER = "(\d\.\d\.\d)";/',
        'lines' => 54,
      ),
      'files' => array(
        'php' => array(
          'src/Client.php',
          'vendor/autoload.php',
        ),
      ),
    ),
  );
}