Fatal error trying to add HubSpot handler in webform

Created on 19 September 2023, about 1 year ago

Problem/Motivation

Getting a fatal error when adding Hubspot webform handler.

Fatal error: Declaration of SevenShores\Hubspot\Http\Response::getStatusCode() must be compatible with Psr\Http\Message\ResponseInterface::getStatusCode(): int in /app/vendor/hubspot/hubspot-php/src/Http/Response.php on line 326

Drupal version: 10.1.3
Webform: 6.2.0-beta6
Hubspot: 3.0.0-alpha2

Steps to reproduce

  • Create a webform
  • Under settings, Emails / Handlers, click on Add handle
  • Right click on the "Add handler" button and open link on a new tab, instead of clicking on the button.
  • The webform handler options will show on a new tab / window instead of showing on an ui dailog.
  • Click "HubSpot Webform Handler"

Getting an error on screen:
Fatal error: Declaration of SevenShores\Hubspot\Http\Response::getStatusCode() must be compatible with Psr\Http\Message\ResponseInterface::getStatusCode(): int in /app/vendor/hubspot/hubspot-php/src/Http/Response.php on line 326

Proposed resolution

The hubspot-php library suggests to lock psr/http-message to version v1.1.
https://github.com/HubSpot/hubspot-php/commit/b54c24bbb6585bddf358103ff6...

πŸ› Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia KelvinWong

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @KelvinWong
  • Status changed to Needs review about 1 year ago
  • πŸ‡¦πŸ‡ΊAustralia KelvinWong

    Patch provided to lock psr/http-message to version v1.1.

  • Status changed to RTBC about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States danflanagan8 St. Louis, US

    I ran into this same thing trying to edit an existing handler. Exactly the same modules version as in the IS.

    I added required psr/http-message:^1.1 in my project and that has fixed the bug. It would be great to see this patch committed. Thanks!

Production build 0.71.5 2024