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.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2553337-acquia_connector-fix-d8-beta-14-2.patch | 852 bytes | CalebD |
Comments
Comment #2
CalebD commentedHere is a patch.
Comment #3
CalebD commentedThe JSON needs to be PHP associative arrays. New patch.
Comment #4
irek02 commentedCalebD, 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.
Comment #5
irek02 commentedComment #6
anavarre