hubspot-php icon indicating copy to clipboard operation
hubspot-php copied to clipboard

Magento2 intergration with hubspot-php

Open sgeleon opened this issue 1 year ago • 1 comments

I am experiencing an issue in Magento 2. In version 5.0.1 of the hubspot-php package, I received the following message:

[Wed Sep 25 18:21:48.072967 2024] [proxy_fcgi:error] [pid 1585596] [client 108.162.250.196:0] AH01071: Got error 'PHP message: PHP Fatal error:  Declaration of SevenShores\\Hubspot\\Http\\Response::getStatusCode() must be compatible with Psr\\Http\\Message\\ResponseInterface::getStatusCode(): int in /var/www/html/www.betterbatt.com.au/site/releases/20240925044615/vendor/hubspot/hubspot-php/src/Http/Response.php on line 323'

To fix this, I tried updating the hubspot-php package to the latest version, 5.2.0, where I found a solution to the issue. However, I encountered the following problem:

 Problem 1
    - Root composer.json requires hubspot/hubspot-php 5.2 -> satisfiable by hubspot/hubspot-php[5.2.0].
    - hubspot/hubspot-php 5.2.0 requires psr/http-message ^1.1 -> found psr/http-message[1.1] but these were not loaded, likely because it conflicts with another require.

Magento is using version 2 of psr/http-message.

To fix this, please update the composer.json file with the following change:

   "require": {
         "psr/http-message": "^1 || ^2",
    }

sgeleon avatar Sep 26 '24 10:09 sgeleon

Hi @sgeleon The support of psr/http-message:^2.0 was added in the latest version.

ksvirkou-hubspot avatar Oct 07 '24 15:10 ksvirkou-hubspot