Problem/Motivation

After updating a site with Acquia Connector to Drupal 8.0.0 beta 14, I received various exceptions and errors related to Acquia Connector. I tracked these issues down to incompatibilities with Guzzle 6, which Drupal 8.0.0 began using in beta 13 (https://www.drupal.org/node/2493911). I did not notice any other issues with functionality in beta 13 but I also did not run unit tests. I did check the status report and do some manual data updates which worked properly.

Proposed resolution

Make code changes to use the Guzzle 6 API.

The constructor in Drupal\acquia_connector\Client calls $this->client->setDefaultOption('verify', (boolean) $this->config->get('spi.ssl_verify')); but setDefaultOption is no longer part of GuzzleHttp\ClientInterface. Configuration of a Guzzle client is done when the object is instantiated and the interface exposes no way to change it. In my local changes I removed this line, but I'm not sure what the proper course of action is here. To allow the SSL verification setting to be customized a separate Guzzle object would need to be created and declared a as service. Well, if the setting differs from core's default of TRUE for verify.

In Drupal\acquia_connector\Client::request() there are changes to the usage of the Guzzle response object. To be PSR-7 compliant, GuzzleHttp\Psr7\Response no longer has a json method. We muse instead use json_decode on the response object body.

Comments

CalebD created an issue. See original summary.

CalebD’s picture

StatusFileSize
new840 bytes

Here is a patch.

CalebD’s picture

StatusFileSize
new852 bytes

The JSON needs to be PHP associative arrays. New patch.

irek02’s picture

CalebD, 8.x-2.x branch is no longer relevant. We decided to start the codebase for D8 from 8.x-1.x which I think makes more sense. Sorry about the confusion. 8.x-1.x was updated by Stanislav Mixnovich to work with beta 14.

I will remove 8.x-2.x branch from the repo.

irek02’s picture

Status: Needs review » Closed (fixed)
anavarre’s picture

Version: 8.x-2.x-dev » 8.x-1.x-dev