My #__fabrik_joins table is all messed up again.
I have been sporadically getting some weird errors that mention joins on tables or elements that I deleted months ago.
I suspect it has to do with records that have zero as the element_id or group_id ? maybe it is trying to join the zero ids? And I realize there has been a lit of Github 'fixes' applied to my Fabrik component - some of which may have trashed some of the data without later correcting it. And there is always the possibility that I might have altered or deleted a table or two via phpAdmin instead of Fabrik.
I suggested long ago that some ?maintenance? script should be developed to verify the relationships in the Fabrik tables ? especially the joins and elements tables as they seem to be the 2 tables most easily trashed.
This morning I wrote a quick script that loops through the #__fabrik_joins table and queries each of the the related tables on the id specified in the joins table and reports if the id is not found.
What I need to know is what the rules would be ? that I can go by - to delete the invalid join records in the #__fabrik_joins table?
Here?s what I think is safe to delete - i.e. any #__fabrik_joins records where ?
I have been sporadically getting some weird errors that mention joins on tables or elements that I deleted months ago.
I suspect it has to do with records that have zero as the element_id or group_id ? maybe it is trying to join the zero ids? And I realize there has been a lit of Github 'fixes' applied to my Fabrik component - some of which may have trashed some of the data without later correcting it. And there is always the possibility that I might have altered or deleted a table or two via phpAdmin instead of Fabrik.
I suggested long ago that some ?maintenance? script should be developed to verify the relationships in the Fabrik tables ? especially the joins and elements tables as they seem to be the 2 tables most easily trashed.
This morning I wrote a quick script that loops through the #__fabrik_joins table and queries each of the the related tables on the id specified in the joins table and reports if the id is not found.
What I need to know is what the rules would be ? that I can go by - to delete the invalid join records in the #__fabrik_joins table?
Here?s what I think is safe to delete - i.e. any #__fabrik_joins records where ?
- there is an invalid ?element_id? - either 0 (zero) or not found in the elements table
- there is an invalid ?group_id? - either 0 (zero) or not found in the groups table
- there is an invalid ?list_id? ? an ID not found in the lists table
- a ?join_from_table? table name where the table does not exist
- a ?table_join? table name where the table does not exist