Error occurs while trying to log an error

Created on 20 January 2025, 11 days ago

Problem/Motivation

Attempting to perform operations when the module is not configured can produce an error which is then not handled properly, and leads to the following error screen:

The website encountered an unexpected error. Try again later.

Error: Call to a member function getBody() on null in Drupal\xero\XeroQuery->logRequestError() (line 742 of modules/contrib/xero/src/XeroQuery.php).

Drupal\xero\XeroQuery->execute() (Line: 473)
Drupal\commerce_xero\Form\StrategyForm->getAccountOptions() (Line: 141)
Drupal\commerce_xero\Form\StrategyForm->buildForm()

Steps to reproduce

Install the Xero API and Commerce_xero modules, but dont configure Xero API. Go to /admin/commerce/config/xero/strategy and click Add Strategy.

Proposed resolution

The error handling in XeroQuery.php should check for null, and log a suitable message.

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024