- Issue created by @swirt
- πΊπΈUnited States edmund.dunn Olympia, WA
As requested! :)
This uses the php boolval() function. It also accounts for yes/no strings.
- πΊπΈUnited States swirt Florida
Thank you for the contribution @edmund.dunn I will take a look at this soon.
- πΊπΈUnited States edmund.dunn Olympia, WA
Somehow the first one ended up empty. This one has the patch.
- Status changed to Needs work
over 1 year ago 2:06am 21 June 2023 - πΊπΈUnited States swirt Florida
I think this solution is a little too restrictive as string versions of true or false both evaluate to 1
php > boolval('true'); php > echo boolval('true'); 1 php > echo boolval('false'); 1 php > echo boolval('FALSE'); 1 php > echo boolval('TRUE'); 1
This creates a situation where we have a bypass mapping for 'yes' and 'no' but none for 'TRUE' or 'FALSE' or 'null', or 'NULL'. I'll re-work this a bit to give more predictable results and also allow mapping for other values that might not be English.
-
swirt β
committed 3dab687d on 8.x-2.x authored by
edmund.dunn β
Issue #3366789 by edmund.dunn: Create convert to boolean process plugin
-
swirt β
committed 3dab687d on 8.x-2.x authored by
edmund.dunn β
- Status changed to Fixed
over 1 year ago 4:16am 21 June 2023 - πΊπΈUnited States swirt Florida
I modified this to allow for config based string mapping.
Simple
field_boolean: plugin: convert_boolean source: boolean
Using optional mapping
field_boolean: plugin: convert_boolean source: boolean map_true: - yes - Yes - si map_false: - no - No - nada
Automatically closed - issue fixed for 2 weeks with no activity.