Ok things were working until I tried to load my Contentbuilder froms. Contentbuilder is a forms type extension from Crosstec.de. If I tried to load the form it broke. After many more hours of debugging I figured it out. Your database driver searches for table name of #__content to decide if it should translate. When Contentbuilder loads a form, it sends this query through the driver
sql = '
Select
forms.config,
forms.verification_required_view,
forms.verification_required_new,
forms.verification_required_edit,
forms.verification_days_view,
forms.verification_days_new,
forms.verification_days_edit,
forms.verification_url_view,
forms.verification_url_new,
forms.verification_url_edit,
contentbuilder_users.userid,
forms.limit_add,
forms.limit_edit,
(Select count(id) From #__facileforms_records Where form = 3 And user_id = 407) As amount_records,
contentbuilder_users.verified_view,
contentbuilder_users.verified_new,
contentbuilder_users.verified_edit,
contentbuilder_users.verification_date_view,
contentbuilder_users.verification_date_new,
contentbuilder_users.verification_date_edit,
contentbuilder_users.limit_add As user_limit_add,
contentbuilder_users.limit_edit As user_limit_edit,
contentbuilder_users.published
,\'0\' As edited
From
#__contentbuilder_forms As forms
Left Join
#__contentbuilder_users As contentbuilder_users
On ( contentbuilder_users.form_id = forms.id And contentbuilder_users.userid = 407 )
Where
forms.id = 32
And
forms.published = 1
As you can see, it selects from a table called #_contentbuilder which equates to TRUE in a strpos() search in your driver in the translateQuery() function within this piece of code
//search for a supported table
$tables = $this->jd->getTable();
foreach($tables as $table) {
if (strpos($this->sql, $table->name) !== false) {
$translate = true;
}
Well the condition evaluates to TRUE since #__content is the beginning #__contentbuilder. You need to search for for an exact match.
I patched it by concatenating a space after $table->name but I think the best answer is to replace strpos with a regex match.
Joe