error with table filter on joined table's element

cookn22

Active Member
I'm using the latest revision of fabrik 1.0.6 and MySQL 4.0.18.

I have a table that is entitled 'Client List', where the database table 'client' is left joined to a table 'cases' on the key 'client_id'. There is a second left join between table 'cases' and table 'case_color' on key 'case_id'. I have the option 'Create table filter for this element' selected for the element 'color_name' in the group '40: case_color - [joined to Client List]'. The type of filter is 'dropdown'

When I go to the table view, I'm getting this error:

Unknown table \'cases\' in on clause SQL=SELECT DISTINCT( case_color.color_name ) AS elText, case_color.color_name AS elVal FROM client LEFT JOIN case_color ON case_color.case_id = cases.case_id\n WHERE TRIM(case_color.color_name) <> \'\' GROUP BY elText ASC
I'm pretty sure I tried to do something like this with a previous revision of fabrik and it worked, but unfortunately I can't get more specific than that (it was awhile ago).

ALSO, the error does not appear when the type of filter is set to 'field', but on the other hand a more involved error appears when the type of filter is 'range' (yikes!). I'm not planning on using the range filter, but here's the error:

Unknown table \'cases\' in on clause SQL=SELECT DISTINCT( case_color.color_name ) AS elText, case_color.color_name AS elVal FROM client LEFT JOIN case_color ON case_color.case_id = cases.case_id\n WHERE TRIM(case_color.color_name) <> \'\' GROUP BY elText ASC
Warning: Invalid argument supplied for foreach() in /home/apache/share/htdocs/uabsap/familycourt/components/com_fabrik/fabrik_table.class.php on line 2599
Unknown table \'cases\' in on clause SQL=SELECT DISTINCT( case_color.color_name ) AS elText, case_color.color_name AS elVal FROM client LEFT JOIN case_color ON case_color.case_id = cases.case_id\n WHERE TRIM(case_color.color_name) <> \'\' GROUP BY elText ASC ' a.mainlevel-nav:link { color:#FFFFFF, font-weight:bold; text-decoration:none; } .fabrikTable a:link { color:#FFFFFF, font-weight:bold; text-decoration:none; } .fabrikTable th a:link { color:#FFCC66; font-weight:bold; text-decoration:none; } .style7 {font-size: 14pt; font-weight: bold; }
 
Im taking a look at this one for you now...
will let you know when ive replciated it and fixed it

cheers
Rob
 
ok this one should be fixed in the SVN now, let me know if an update fixes the bug on your site

Cheers
Rob
 
alright! that fixed it. Fabrik tech support is always stellar, you guys rock.

On a different subject: I think I found a bug in the prefilter code in fabrik_table.class (function starting on line 2022). I was trying to do an eval filter and was constantly getting SQL errors. I turned fabrikdebug on and changed settings a bit to see if I could find out what was up. Changing to different types of filters didn't produce any noticeable difference in what was coming up in the debug, so I checked out the code.

I put this line of code above the first for loop:

echo "<pre>";
print_r($afilterEval);
echo "</pre>";
and on the table view it spit out this:

Array
(
[0] =>
[1] => on
[2] => on
)
That's clearly not right for two prefilters.
So, I put in this code before the for loop:

unset($afilterEval[0]);
$temp = array_values($afilterEval);
$afilterEval = $temp;

that fixed the error by taking out the empty key value pair and
reordering the array. Obviously it's a quick hack, but the point is
that somehow an empty value is being put in the first index of
$afilterEval array and it was screwing up the prefilters. I believe I'm using the latest rev of fabrik but I'll doublecheck to make sure. I'm using PHP v. 4.3.6RC3.
 
Ack pbffft. I remember us being in param hell for a while trying to sort out some similar issues with repeated params. I'll take a look over the weekend. Right now it's coming up 6pm on Fri night, and I intend to eat a huge dinner, then go out, play some blues and drink waaay too much Jack Daniels (don't fret, my wife is designated driver).

Oh, one thing. As of the last 1.0.6 ZIP, we're dropping support for PHP4. This won't have any immediate effect, but if we ever do release a 1.0.7, we can't guarrantee PHP5 code won't creep in to it. Just a heads up.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top