1. Fabrik 3.5.2 is now available to download. Read the blog for highlights about this release.

    As always, please back up your site prior to updating and if possible test in a dev environment first.

    Also, our 3.5.1 package file was hacked, the effected dates were 1/15/2017 - 1/17/2017. If during those days you downloaded the 3.5.1 package file from the JED or our site download page, please re-install the package with a fresh copy or upgrade to Fabrik 3.5.2. Github downloads were not effected.

Table Join not working with Fabrik 3.X

Discussion in 'Fabrik 3.x Testing' started by ritesh123, May 6, 2012.

  1. ritesh123

    ritesh123 Member

    Level: Community
    I have a "table 1" with its primary key as "id"
    and "table 2" with foreign key as "table1_id"

    I have done table join like this

    left JOIN table2 ON table1.id = table2.table1_id

    On Edit i am not getting any joined details as the foreign key in table is not updated in table2 in database
  2. troester

    troester Well-Known Member Staff Member

    Level: Standard
    In fabrik3 it's "lists". Did you add a join to the list "table1" in fabrik?
    Is the joined group set to repeatable?
    What is your Joomla and fabrik version?

    What are the fabrik element types (plungins) of id and table1_id? published? edit access?
    1 person likes this.
  3. ritesh123

    ritesh123 Member

    Level: Community

    I am using Joomla 2.5
    Fabrik 3.x ( Latest updated today from Github)

    Yes, joined group is set to repeatable

    All tables are list , i know. Since I am a old Fabrik user so designated list as tables.

    All the ids are published and editable.

    I am using "table1.id" as primary key which is having element as internalid which is integer(11)

    table2.table1_id as field which is a integer(11)

    Then also after saving the Records through Form it is not updating the foreign key table2.table1_id

    I have used Join condition

    left JOIN table2 ON table1.id = table2.table1_id

    "table2.table1_id" value should be equivalent to "table1.id"
  4. troester

    troester Well-Known Member Staff Member

    Level: Standard
    It's weekends, even for Silver subscribers support is ...48h excluding weekend...

    It's working on my site without problem.

    Does table2 have a primary key?
    Check all your element settings in table1-[table2] group (id, table1_id)
    Enable fabrikdebug to check the query.
  5. rob

    rob Administrator Staff Member

    Level: Community
    check the foreign key is published in the joined group
  6. bichu10

    bichu10 New Member

    Level: Community
    Fabrik 3. table join issue

    Same issue happend to me as well , using joomla 2.5.7 with fabrik 3.0.7.
    Join table FK not get updated with the PK value of Main table after form subission. Only main table updated. joint group's elements type changed to text as well.

    Any solution ???
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Supporter
    Testing this now on a couple of my join torture test forms.

    -- hugh
  8. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Supporter
    I'm unable to replicate this.

    Can someone with this issue catch me on Skype ('cheesegrits') and get me logged in to their system, so I can do some hands on work.

    -- hugh
  9. bichu10

    bichu10 New Member

    Level: Community
    Hugh , thanks for your initiative . scenario probably help to replicate the same .
    i have two list ,Main and sub . each had its own PK with auto increment field which is [id] and on the sub table a id_ref field to which the table join from main to sub.
    Once after i setup the join , notice the following
    1. The join group's field type different from the orginal sub table
    2. Backend mySql main table appended with the fields of sub table .
    3. the form of main list appended with join group as it should be , however the PK value of main list not get populated to FK of the sub list.

    The issue 2: eventually gone off after i delete the appended fileds from mysql and delete the rejoin the lists.
    However it recreate the same fileds in mysql of main table as soon as the form submitted.
    Hopefully above gave a better picture of the issue.
    Am also uploading some screes as well.

    Attached Files:

    • 1.JPG
      File size:
      74.3 KB
    • 2.JPG
      File size:
      67.7 KB
    • 3.JPG
      File size:
      74.1 KB
  10. bichu10

    bichu10 New Member

    Level: Community
    Fabrik 3. table join issue : Solved

    Hugh , Just an update . The Issues 2 and 3 managed to resolve by clearing the cache . the steps as follows
    1. Delete the existing join
    2. delete the mysql Main table appended fields
    3. cleared the browser cache
    4. restart the Apache and mySql ]
    5.recreate the join
    May not required all the steps , but after this steps i managed to make the join works . However my point 1 is still an issue as the field type of the join group reset back to text field as my previous uploaded screen.

    Any direction to TS path.

Share This Page