Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grocery Crud Model - set_relation_n_n #459

Open
Akshay-Hegde opened this issue Aug 16, 2018 · 5 comments
Open

Grocery Crud Model - set_relation_n_n #459

Akshay-Hegde opened this issue Aug 16, 2018 · 5 comments

Comments

@Akshay-Hegde
Copy link

Probably we need modification in

function get_relation_n_n_selection_array($primary_key_value, $field_info)
 {

 }

From

$this->db->where($field_info->primary_key_alias_to_this_table, $primary_key_value);

To

$this->db->where('`'.$field_info->relation_table.'`.'.$field_info->primary_key_alias_to_this_table, $primary_key_value);
Column 'group_id' in where clause is ambiguous

SELECT *, CONCAT('', COALESCE(username, ''), '(', COALESCE(email, ''), ')') as s91e87ed5 FROM `default_wf_relation_group` JOIN `default_users` ON `default_wf_relation_group`.`id` = `default_users`.`id` WHERE `group_id` = '3' ORDER BY `default_wf_relation_group`.`priority`
@mckaygerhard
Copy link

interesting workaround.. do you tested ¡? @Akshay-Hegde ?

@Akshay-Hegde
Copy link
Author

@mckaygerhard Yes, I tested it.

@mckaygerhard
Copy link

it's a vbery need workaround i'll tri it in my fork and report some feedback.. very very thanks.. maybe we need a pull request, but i think @scoumbourdis you can integrated without it!

@mckaygerhard
Copy link

hi @Akshay-Hegde i tested and i think you have more code changes that are not noted.. i change the line and get similar behaviour ..

your change works only for the filter.. i mean, the "where" part.. but still we have the "colums" part or values/columns that show

so that issue must change the name of the title to "Grocery Crud Model - set_relation_n_n where clause not ambiguos solution" due we still need to clarify wich column will be show if we include the primery key of both tables in relation.. .. i mean still we have missing solution for the columns to show part

@mckaygerhard
Copy link

mckaygerhard commented Sep 18, 2018

umm @Akshay-Hegde and @scoumbourdis i can see that we can search agains the string "related fiel type" and if we found the common field (well in basic the primary key) we can filter it, remove it and let only one.. what about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants