Bug in multiselect fields -> taxonomy
-
Data returned by GF for multiselect example:
[“3″,”4″,”5”]The exploded array of the above input will return:
array (size=3)
0 => string ‘[“3″‘ (length=4)
1 => string ‘”4″‘ (length=3)
2 => string ‘”5”]’ (length=4)But with if you apply intval to them, it returns
array (size=3)
0 => int 0
1 => int 0
2 => int 0Because of the extra characters (or rather the first character in each array).
On gfcptaddonbase.php line 487:
$terms = array_map( ‘intval’, explode( ‘,’, $entry[ $field->id ] ) );
Don’t know if there’s a good way to convert to int values because brackets. But considering the values area basically in json format, decoding json should work fine.
$terms = json_decode ($entry[ $field->id ]);
- The topic ‘Bug in multiselect fields -> taxonomy’ is closed to new replies.