1. Fabrik 3.7 is now available. This version contains critical security updates, please update as soon as possible. Please remember to backup your site before updating, we also recommend testing your updates on development sites if possible.
  2. We had to restore the site around midday (CST) on Wed 7/26 from a backup approximately 8 hours old. So a few posts in the forums were lost. You may want to check to see if you need to re-post anything.
  3. The release of Fabrik for J! 3.8 is not yet ready. Do not update your sites to J! 3.8 until this notice is removed.

User Element Plugin - Cross Database

Discussion in 'Professional Support' started by burghard, Sep 13, 2017.

  1. burghard

    burghard Member

    Level: Community
    I need the user element plugin for a cross database join because all my data for fabrik are in a different database for my installation (not the joomla database). I would contribute code to it, if I get a pointer to the code (probably in the database join element plugin code).
    In http://fabrikar.com/forums/index.ph...d-in-numeric-not-user-name.45611/#post-235183 cheesegrits states that the dbms MySQL does not support cross database joins. But this seems not to be true since the SQL command
    SELECT * FROM this_database.table_1 t1
    JOIN that_database.table_2 t2 ON t2.column= t1.column

    works well as stated in https://stackoverflow.com/questions/1972943/how-do-i-construct-a-cross-database-query-in-mysql.
    So can anyone give me a pointer to the code?
     
    Last edited: Sep 13, 2017
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    The reason I said "it doesn't support" cross database joins is that this is a version dependent feature (older MySQL versions don't allow it), and it also requires both databases to have the same access credentials (same user and password). This makes it problematic to support in Fabrik.

    As for the code involved ... this is one of those "if you need to ask where the code is, you probably won't be able to modify it" cases. I took a look a while back at extending the join / user elements to support cross database joins, and gave up, because of the huge amount of changes required.

    -- hugh
     
  3. burghard

    burghard Member

    Level: Community
    With "a pointer to the code" I rather mean if it is code in the user element plugin or the databasejoin element because user inherits from databasejoin. I even found some strange behaviour with the databasejoin element between two databases.
    Nevertheless! Let me try it. I found PlgFabrik_ElementUser::getAsField_html(...) to create the SQL query for the select of the value. There a distinction between "same db" and "NOT same db" is made ($this-inJDb()). May be this is the right place to start for me?
     
    Last edited: Sep 14, 2017 at 1:15 PM
  4. burghard

    burghard Member

    Level: Community
    Oops! I posted it on Joomla 2.5 forum. but I am on 3.7 can this thread been switched to the Joomla 3.x forum?
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Moved.

    That would be one place to start. But as I said, the last time I looked at doing this, I discovered many, many layers of complexity and issues that I hadn't anticipated. You are of course welcome to work on it, but I be aware that I suspect it won't be simple.

    -- hugh
     

Share This Page