DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]Unknown[/eluser]
I think I've either found a bug or I'm not using it correctly. Basically what I want to do is search upon a join field between a many-to-many relationship. Here's the code needed to get a test working from a base CI and DMZ install. MySQL Tables & Data http://gist.github.com/518191 Attribute Model http://gist.github.com/518199 Product Model http://gist.github.com/518201 Controller http://gist.github.com/518207 If you browse to the base url, or /welcome/index, you will get the following error: Quote:A Database Error Occurred It's not adding the join for attributes_products. What I ended up doing was editing libraries/datamapper.php and in _join_field() at line 5309 I added a line: Code: // Determine relationship table name, and join the tables I've tried everything from include_related() to include_join_fields() and nothing seems to get the right outcome except this hack above. I've not tested it anywhere else, so I don't know the impact this change will have elsewhere. Am I doing it wrong or is this a bug? Any help is appreciated! EDIT: I noticed I used "or_ilike_join_field", since I copied it from a larger statement, but also "ilike_join_field" does not work |
Welcome Guest, Not a member yet? Register Sign In |