Skip to content

Commit

Permalink
#420: Adding the unique table name so we will not have ambiguous names
Browse files Browse the repository at this point in the history
  • Loading branch information
scoumbourdis committed Aug 9, 2017
1 parent 9c46e62 commit 5d61cc6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions application/libraries/Grocery_CRUD.php
Expand Up @@ -1170,17 +1170,19 @@ protected function _convert_date_to_sql_date($date)

protected function _get_field_names_to_search(array $relation_values)
{
if(!strstr($relation_values[2],'{'))
if(!strstr($relation_values[2],'{')) {
return $this->_unique_join_name($relation_values[0]).'.'.$relation_values[2];
else
{
} else {
$relation_values[2] = ' '.$relation_values[2].' ';
$temp1 = explode('{',$relation_values[2]);
unset($temp1[0]);

$field_names_array = array();
foreach($temp1 as $field)
list($field_names_array[]) = explode('}',$field);
foreach($temp1 as $field) {
list($field_name) = explode('}',$field);
$field_name = $this->_unique_join_name($relation_values[0]).'.'. $field_name;
$field_names_array[] = $field_name;

This comment has been minimized.

Copy link
@mckaygerhard

mckaygerhard Nov 5, 2017

this $field_names_array[] = are php 5.3.10 compatible?

}

return $field_names_array;
}
Expand Down

0 comments on commit 5d61cc6

Please sign in to comment.