Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » convert_parent_id_to_child_id
Re: convert_parent_id_to_child_id [message #7262 is a reply to message #7261] Fri, 08 February 2019 04:50 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2348
Registered: April 2006
Location: Surrey, UK
Senior Member
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']);


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Multi servers and PostgreSQL
Next Topic: Check for empty $schema in dml.psql.class.inc
Goto Forum:
  


Current Time: Fri May 03 01:41:28 EDT 2024

Total time taken to generate the page: 0.00982 seconds