⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Grid search N to N relationship



zuratharamon
  • profile picture
  • Member

Posted 29 November 2011 - 09:06 AM

Another issue that I have found, is that when you have a column from an N to N relationship, the search fails.
First, no error message appears
Second,


<body>
<div id="container">
<h1>A Database Error Occurred</h1>
<p>Error Number: 1054</p><p>Unknown column 'Status' in 'where clause'</p><p>SELECT COUNT(*) AS `numrows`
FROM (`orders`)
LEFT JOIN `supplier` as jc5bcd6 ON `jc5bcd6`.`supplier_id` = `orders`.`supplier_id`
WHERE `Status` LIKE '%Hold%'</p><p>Filename: C:\wamp\www\erp_ci\system\database\DB_driver.php</p><p>Line Number: 330</p> </div>
</body>


On the above query, the status column comes from the N to N table -STATUS-

Thanks
Panos

zuratharamon
  • profile picture
  • Member

Posted 29 November 2011 - 10:10 AM

Damn...
I just saw in the known issues that, what i described is a known issue.... :(

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 01 December 2011 - 21:59 PM

[quote name='zuratharamon' timestamp='1322561400' post='68']
Damn...
I just saw in the known issues that, what i described is a known issue.... :(
[/quote]
It's ok , I am working on it ;) . For now I have only a temporary solution for this. You can see the change that you can do in the version 1.1.4 at https://github.com/s...74b367fef0803ee . This will prevent the error, so the search will be normally for all the fields but NOT for the n-n field. Probably in the next version will be fixed with a normal solution way.

pigfox
  • profile picture
  • Member

Posted 15 June 2012 - 00:33 AM

Has this issue been fixed in the current version 1.2.3?

noskov.biz
  • profile picture
  • Member

Posted 15 June 2012 - 06:33 AM

Hi! As I know this issue is still open in grocery_crud-1.2.3.

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 15 June 2012 - 06:56 AM

Well... it is almost fixed. The thing is that now at least you don't have any error. So the only problem that it's remaining (and that's why it's still open) it is that at the "search all" doesn't search the relation_n_n columns. However if you search only by column, it works as expected.

pigfox
  • profile picture
  • Member

Posted 15 June 2012 - 16:31 PM

Thank you all for the feedback!