TypeError: substr(): Argument #1 ($string) must be of type string, false given in substr() (line 61

Created on 31 May 2024, 6 months ago

Problem/Motivation

Getting error "TypeError: substr(): Argument #1 ($string) must be of type string, false given in substr() (line 61 of /home/www/.../vendor/apimatic/unirest-php/src/HttpClient.php)."

Unirest\HttpClient->execute() (Line: 48)
Core\ApiCall->execute() (Line: 34)
Square\Apis\BaseApi->execute() (Line: 138)
Square\Apis\OAuthApi->obtainToken() (Line: 253)
Drupal\commerce_square\Form\SquareSettings->requestAccessToken() (Line: 127)
Drupal\commerce_square\Form\SquareSettings->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

After entering all API keys and tokens on the settings page and hitting Save, getting the above error.
On PHP 8.3.3

🐛 Bug report
Status

Active

Version

1.7

Component

Code

Created by

🇱🇹Lithuania vzls

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

Comments & Activities

Production build 0.71.5 2024