Problem/Motivation
After updating php to version 8.1, there are problems with the required library hubspot/hubspot-php
Deprecated function: Return type of SevenShores\Hubspot\Http\Response::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 9 of /var/www/vendor/hubspot/hubspot-php/src/Http/Response.php).
include('/var/www/vendor/hubspot/hubspot-php/src/Http/Response.php')
Deprecated function: Return type of SevenShores\Hubspot\Http\Response::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 9 of /var/www/vendor/hubspot/hubspot-php/src/Http/Response.php) Proposed resolution
Update hubspoth/hubspot-php to newest version
Issue fork hubspot-3323840
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
Comment #3
stella commentedAlternative composer patch if stuck before 7.4 EOL:
https://github.com/HubSpot/hubspot-php/pull/378
https://patch-diff.githubusercontent.com/raw/HubSpot/hubspot-php/pull/37...
Comment #5
joaopauloscho commentedI'm not sure if https://www.drupal.org/project/hubspot/issues/3388150 would be a duplicate of this but I'm adding
psr/http-message:^1.1as a requirement along withhubspot/hubspot-php:^5.0. The reason of this is because the hubspot newest version (5.2) requires psr/http-message::^1.1 now. Please take a look, thanks!Comment #6
gigiabba commentedI've tested this patch on a Drupal 10.3.x fresh install, with PHP 8.1, and solved the issues found using the 3.0.0-alpha4 version.
Comment #7
richgerdesThanks for the fix!