Hi,
I seem to have found a solution to this problem. Here's my original summary:
When go to add a filter to a Node View, for example a fresh query that has no other filters/arguments/relationships defined, I get the option to add filters from the aggregate MySQL-view tables (eg uc_order_products_qty_vw), like for example Order Product: min_qty. However filters on the uc_order_products table, like for example Order Product: qty, don't show up in the list of applicable filters.
The attached patch seems to remedy the situation. It also fixes a problem with correlating the uc_orders and node tables that was at least partially addressed in this commit. Though it seems like that fix needed to be applied in two directions?
The patch also makes uc_order_products a base table. Changing it to a base table was actually my first attempt at fixing the problem and didn't work, or at least wasn't sufficient to solve the problem. However my nascent understanding of the Views API suggests that this table should be a base table, so I left it that way.
The root problem seemed to be that the $data['${tablename}']['table']['join'] = array ( .... calls were overwriting joins for that ${tablename} with other tables. The patch does seem to resolve the problem I was having: the filters for the uc_order_products table now appear on the list of filters when building a view, and function when applied. I'll be continuing to use my patched uc_views and will post here if any problems arise.
| Comment | File | Size | Author |
|---|---|---|---|
| uc_views-enable_order_products_filters.patch | 3.88 KB | intuited |
Comments
Comment #1
madsph commentedThanks, I will look into this - just this morning I realized that there seems to be a problem with uc_order_products fields. I think the problem is related to how it is joined with node after we made uc_orders a base table. At least I can't get Order product fields (other than those from the db-views) to appear in the list when creating new views with node as base.
My guess is that this is a related problem - so I am thrilled that you may have a solution for it.
I will get back to you as soon as possible.
Comment #2
madsph commentedI applied your patch and added a join to node. This seems to work as it should. Thank you for your help!
Comment #3
intuited commentedPleasure. Thanks for making the module!
Comment #4
madsph commentedComment #5
socialnicheguru commentedIs this committed?
Comment #6
madsph commentedYes if you use the 6.x-3.x-dev release. Even if it is a dev release I consider it pretty stable.