Fatal error in the backend when adding joins

Status
Not open for further replies.

jfquestiaux

Well-Known Member
Tested with GitHub version 627.

When you try to add a second join to a list, or to edit an existing (single) one (like going from "left join" to "inner join"), you get this error :

1054 Unknown column 'table_join_alias' in 'field list' SQL=UPDATE `og6a1_fabrik_joins` SET `list_id`='49',`element_id`='0',`join_from_table`='invoices',`table_join`='purchases',`table_key`='id',`table_join_key`='invoice_id',`join_type`='inner',`group_id`='130',`table_join_alias`='purchases' WHERE `id`='360'

And indeed, there is no "table_join_alias" column in the #__fabrik_joins table, hence the error.
I think that gives also an error in the frontend as this list, having two joins set before the recent updates, shows a MySQL error when you try to display it, reported an alleged unknown column.
 
Hi Rob.

The error is gone alright, but there is still a bug: when you create a new join you get just a message saying "error" without more details.
When you check, you see that:
  • The join is indeed created
  • The corresponding group is created
  • BUT there are no elements in this group, so in the list view, you see only the "main" list and nothing from the joined one
Tested with latest 3.1 GitHub
 
I'm not sure if I was seeing exactly the same thing as you, but I think I have fixed it. Would you mind updating and testing please?
 
Yes, after update from GitHub 754, the creation of join is correct.

There might be some problem left though, but I have not had the time to test fully: my understanding of joins was that you always need to have one of the elements "From element" OR "To element" to be a PK. But with the little test I did, I get a MySQL error if the PK is not the "From element" element.

If I set the PK on the "To element", the query fetches wrong parameters. For instance if I have

LEFT join from PURCHASES to MEMBERS from element MEMBER_ID to element ID

I get a MySQL error saying "unknown column members.member_id", which is true because there is no column member_id in the members table, but it should look for "members.id" and not "members.member_id" which is in the purchases table.

If I do the join in the other around, it works fine.
 
Did this one get cleared up with one of those commits of yours we did a few weeks ago, or is it still an issue?

-- hugh
 
To be honest, this is quite old and either it's working now or I found another way around it. In any case, I did not encounter any join issue lately.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top