Unfortunately your suggested fix will break existing applications. When I originally wrote the array2where() function it converted the string "field=value" into an associative array(field => value) which assumes that the operator is '='. In some cases I have to deal with WHERE strings where the operator is LIKE or BETWEEN or IN. This is why I added the extra argument to the where2array() function so that it will not strip the operators out so that they will be preserved when converting the array back into a string.
The correct fix is to strip the operators from the supplied value in the convert_parent_id_to_child_id() function before it is used. You can do this by changing
$fieldarray[$child_name] = $fieldarray['id'];
to
$fieldarray[$child_name] = stripOperators($fieldarray['id']);