VippsApiConfig::isTest can crash if config is not bool

Created on 28 February 2025, about 1 month ago

Problem/Motivation

If setting the config in a regular manner, the config for test mode can end up for example "0". This is not a boolean value, and can then crash things with

TypeError: Drupal\vipps_recurring_payments\Service\VippsApiConfig::isTest(): Return value must be of type bool, string returned in Drupal\vipps_recurring_payments\Service\VippsApiConfig->isTest()

Steps to reproduce

Well luckily I am about to add a test that shows it.

Proposed resolution

Make sure the value is bool before returning it.

Remaining tasks

Review and commit.

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇳🇴Norway eiriksm Norway

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024