Boolean values always evaluated as TRUE

Created on 9 May 2024, 8 months ago

Problem/Motivation

Boolean fields on external entities mapped using the "String functions and JSONPath" plugin are always evaluated as TRUE.

Steps to reproduce

Create a boolean field on an external entity. Map it with the "String functions and JSONPath" plugin (in my case the mapping was $.additionalInfo.available). FALSE will be converted to the 'FALSE' string in StringJsonPath::extractValueFromRawDataUsingMapping(), and TRUE to 'TRUE', which will always be evalued to TRUE (conversion of a non-empty string) later on in BinaryData::getCastedValue() (called from ExpressionFieldMapperBase::processPropertyValue()).

Remaining tasks

Figuring out a fix. Unfortunately I cannot provide a patch as I do not understand the full logic in StringJsonPath::extractValueFromRawDataUsingMapping().

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France fmb Perpinyà, Catalonia, EU

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

Comments & Activities

Production build 0.71.5 2024